Build 4.9.0.12 of xlsgen adds to JSON data import, HTML data import and XML data import the same properties added to CSV data import in the previous build. Namely,
- AutoFormatMapping (boolean) : enable or disable the automatic pattern matching algorithm. It needs to be disabled in cases where the algorithm tries hard too much finding patterns and ends up creating more number formats than Excel actually accepts (200).
- FirstRow : as the name implies this allows to tell at which first row the CSV content should be inserted. Before this, row could be specified on a per column basis, but this property is for all columns in a single statement.
- FirstColumn : same than FirstRow, except for columns.
Sample :
// importing a sample JSON file
xlsgen::IXlsWorksheetPtr worksheet = workbook->AddWorksheet(L"Sheet1");
xlsgen::IXlsJSONImportPtr json = worksheet->Import->JSON;
json->Options->AutoFormatMapping = FALSE;
json->Options->FirstRow = worksheet->HorizontalPane->SplitLimit; // insert the data right after the split
json->ImportFile(L"input\\jsonfile3.json");