I am attempting to create an app that loads an arbitrary designer spreadsheet that is populated via a series of smart markers and where the data source is a json file. However, I have a series of numeric fields whose values are being inserted into the output.xlsx as text values rather than numeric. When I open the output file I see these values are flagged as text and excel is able to convert them to numbers.
Please help me understand how I can get these cells to populate with numeric values. The only way I’ve been able to do so is to define the shape of the accounts object in code (see SetDataSourceAnonymousObject vs SetDataSourceFromJson in WorkbookBuilder.cs). ExcelDotNetCorePoc.zip (520.5 KB).
I’ve formatted the columns in the designer spreadsheet (LedgerTemplate.xlsx) as ‘Accounting’ formats and here’s how I’ve defined the smart markers:
&=sourceData.accounts.actual(numeric, skip:1)
&=sourceData.accounts.budget(numeric, skip:1)
The json file also defines these values as numbers.
{
"accounts": [
{
"title": "Advertising",
"code": "adv1000",
"actual": 401475,
"budget": 415000
},
{
"title": "Office Equipment",
"code": "WBMason",
"actual": 43120,
"budget": 30000
}
]
}
I’ve zipped and uploaded the solution and projects to reproduce this behavior. Please let me know if you need any additional information or have any suggestions to reliably get these columns to output as numeric data when the values are in fact numeric.