I have search around the web but could not find any solution. I have a Excel file used as a template, with a area to parse data from DB. Among the columns of the Excel file, there is a number column with a custom format. My code (C#) of setting data to Excel file is as below:
Aspose.Cells.Worksheet ws;
Aspose.Cells.Range rg;
...
rg = ws.Cells.CreateRange("A1", "M10");
var setData = genDataArray(dt); //this function convert Datatable to 2D object array
rg.Value = setData;
Another attempt is also a failure:
ws.Cells.ImportDataTable(dt, false, "A1");
The code works fine. Data is set correctly to the Excel file, but without any format of the Excel file.
When I click the cells of Excel file (after the process), and press Enter, the value is formatted with the style I previously set in the Excel file.
How can i make the Aspose to apply the format I set in the Excel file?
Thank in advance.