LoadFromDataTable Add data type detection For Excel Range
Currently exporting Excel data, NumberFormat of Excel cell range is not set based on data type of DataTable
It is recommended to add the ability to specify Excel Range NumberFormat based on the DataTable data type, especially long integer fields. If String is specified in the DataTable and can be exported, NumberFormat is automatically set to "@" before exporting, so that the numbers can be displayed completely.
You can set number formats via attributes if desired...https://github.com/EPPlusSoftware/EPPlus/wiki/LoadFromCollection-using-Attributes. As we don't know what the desired number formats is from the data type, we can not set it that way.
You're right, but if you still want to use LoadFromDataTable to do a lightweight export instead of defining a class that has specific definitions,
one of the biggest problems with the DataTable right now is that it's a text type. If I just let Excel determine the data type, it's easy to lose precision with long integer numbers.
I think I can rely on EPPLUS to convert the corresponding column to text type, Numberformat to @, when I finally write to Excel cells with a text type defined in the DataTable.