Hello,
I am currently stuck on a problem. I would like to export data from an excel file to a collection of Objects.
I would like to export a certain column as a string, but it can also contain numbers. However, decimal numbers are still rounded. And for numbers smaller than 0.5, it is rounded to 0 and the result as string is "".
List
In the ExcelTag class, the column has the type string
|
Original Excel Value
|
Result
|
| 2 | "2" |
| 1,6 | "2" |
| 0,3 | "" |
Hi Friedhelm,
Greetings from Syncfusion.
We are unable to reproduce the issue at our end. We request you share the collection object class structure and Excel document which is used to export data to proceed further and provide you a solution at the earliest.
Regards,
Mohan.
Hello Mohan,
thank you for the quick reply.
I have attached the affected excel file excerpt and the "ExcelTag"-Class for you.
In this example the column "Hysteresis"(G) is affected.
The export is called up as follows:
IWorksheet worksheet = workbook.Worksheets["Tags"];
if (worksheet == null)
{
return new List<ExcelTag>();
}
List<ExcelTag> tags = worksheet.ExportData<ExcelTag>(START_ROW, START_COL, END_ROW, END_COL);
Hello,
I have found the problem. You could not recreate the problem because you got a simplified version of the Excel document.
In the original file the columns M-U are hidden (Worksheet: Tags). If I show these columns and then do the import, it works without the bug.
This means that the workaround for us will now be to leave the columns permanently displayed.
For reference, I have attached the affected Excel file in its original format
Thanks for the great support (: