I'm using the latest version of AspNetZero (v9.1.0) .NetCore with angular. I am trying to export my grid using the ExportToFile used in the auditLog as a example
The Excel Spreadsheet is getting generated correctly except all my decimal values (Dollar amounts) are flagged with a warning as "The number in this cell is formatted as text or preceded by an apostrophe"
This is how it defauls so I then tried using a variety of methods to format the currency For example.
ICellStyle currencyFmt = sheet.Workbook.CreateCellStyle(); currencyFmt.DataFormat = (short)7; //"($#,##0.00);($#,##0.00)" sheet.SetDefaultColumnStyle(5, currencyFmt);
How do I have amount get output as numbers into Excel so I can do computation on them
I know if I multiply the values by a cell containing a 1 that the numbers convert to a number but that is a cumbersome hack.
It seems like NPOI library has some problems about this https://github.com/dotnetcore/NPOI/issues/132. You can format the text and set the cell content manually.