Hi,
Hi,
Could you post your template file here, we will check your issue soon.
Thank you.
Hi,
Attached a sample template has been conditional formatted Custom > #,##0_ ;[Red]-#,##0
So When I enter 10.99 it shows as 11 and 9.4 as 9
And i expected 10.99/9.4 when i do datatable export.
Hi,
Please try the attached version.
I have tested with it using the following sample code and it works fine.
Sample code:
Workbook workbook = new Workbook(“e:\test\TemplateTest.xls”);
Worksheet worksheet = worksheet = workbook.Worksheets[0];
worksheet.Cells[“B1”].PutValue(10.99);
DataTable dt = worksheet.Cells.ExportDataTable(0, 0, worksheet.Cells.MaxDataRow + 1, worksheet.Cells.MaxDataColumn + 1);
int index = workbook.Worksheets.Add();
Aspose.Cells.Worksheet worksheet2 = workbook.Worksheets[index];
worksheet2.Cells.ImportDataTable(dt,false, “A1”);
workbook.Save(“e:\test\outTemplateTest.xls”);
Thank you.
I used ExportDataTableAsString and -999.99 read as -1000 ( the formatted display)
Hi Naren,
A cell in an Excel file has a Cell Value & a Cell string value. When you use ExportDataTableAsString, it returns the string value of the cell on the other hand if you use ExportDataTable it will return you the cell value of the cell. So, you can use ExportDataTableAsString method in order to get string value (displayed value) & ExportDataTable in order to get actual value of the cell.
Thanks,
Hi,