Hi folks. There seems to be a lot of questions about this and every answer I could find pointed me at some web solution. This is Winforms and nothing I've seen so far has been in line with my current issue - so here goes!
WinForms .Net 4.7.2 VB
A simple grid (See gridPIC.png)
3 Columns:
- Decimal DecimalPlaces = 0 FormatString = {0:N0}
- Decimal DecimalPlaces = 2 FormatString = {0:N2}
- Decimal DecimalPlaces = 4 FormatString = {0:N4}
Export property settings:
- HiddenColumnOption = HiddenOption.DoNotExport
- SummariesExportOption = SummariesOption.DoNotExport
- ExportVisualSettings = False
When using ExportFormat = SpreadStreamExportFormat.Csv you can see the integer shows 111, the 2 decimal data shows 222.22 and the four decimal data shows 333.3333 as expected. (See csvPIC.png)
But when using ExportFormat = SpreadStreamExportFormat.Xlsx the results are incorrect (*See ExcelPic.png)
I was expecting that the export file would include the format information. I thought perhaps because I'd set spreadStreamExport.ExportVisualSettings = False that this was the cause but I can flip that to True and the output is identical.
The DATA that gets into Excel IS CORRECT. It's just not formatting the cells as expected.
Is there any way for spreadStreamExport to output the proper Decimal formatting?
If yes, can you point me at a sample? C# is just fine if you folks aren't vb.net users.
Thank you all!
Curtis