Posted 14 September 2017, 12:03 pm EST
Regular (pure?) javascript, with the following libraries
- jQuery 3.2.0
- Bootstrap 3.3.7
- Bootstrap Datepicker 1.6.4 (https://github.com/eternicode/bootstrap-datepicker)
- Select2 4.0.3
- JSZip 3.1.3
- Wijmo 5.20163.259
Excel 2016 (Office 365, current)
Using the wijmo.grid.xlsx.FlexGridXlsxConverter.saveAsync function results in a file that Excel has to repair. On opening in excel, a dialogue pops up with “We found a problem with some content in ‘’. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes.” <Yes/No buttons>.
After clicking yes, it shows a dialogue with “Repairs to ”: Removed Records: Formula from /xl/worksheets/sheet1.xml part, after which the “repaired” data seems to be fine. It seems to happen sporadically on smaller result sets, but will always happen on larger result sets (500+ rows). Also, on larger result sets (which can take several seconds to generate and save) it seems that it is not saving asynchronously.
I believe our 1-year period for updates is over, so what are the options to fix this?
These are the grid options:
resultsGrid = new wijmo.grid.FlexGrid('#resultsGrid', { autoSizeColumns: false, autoGenerateColumns: false, columns: [{ binding: 'id', header: 'ID', visible: false }, { header: '', isReadOnly: true, width: 25, cssClass: "customer-details-link" }, { binding: 'name', header: 'Name', isReadOnly: true, minWidth: 250, width: "*" }, { binding: 'bfoid', header: 'bFO ID', isReadOnly: true, width: 125 }, { binding: 'earliestShipDate', header: 'Earliest Shipped', dataType: "Date", format: 'MM/dd/yyyy', align: 'right', isReadOnly: true, width: 150 }, { binding: 'lastShipDate', header: 'Last Shipped', dataType: "Date", format: 'MM/dd/yyyy', align: 'right', isReadOnly: true, width: 150 }, { binding: 'totalMoneySpent', header: 'Total Spent', dataType: 'Number', format: 'c', isReadOnly: true, width: 150 }, { binding: 'mergedCustomers', header: 'Merges', isReadOnly: true, width: 150 }], selectionMode: wijmo.grid.SelectionMode.Cell }); /* ... ajax to get data, then collection view is assigned to itemsSource ... */ // Save the flexGrid asynchronously to an xlsx file. // Based on browser performance, something is not working asynchronously - it locks up the browser and the export status set via jQuery prior to this call is not displayed until it is finished wijmo.grid.xlsx.FlexGridXlsxConverter.saveAsync(resultsGrid, { includeColumnHeaders: true, includeCellStyles: false }, // options fileName, // filename function (base64) { // onSaved // User can access the base64 string in this callback. //$('#export').href = 'data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;' + 'base64,' + base64; $('#statusString').text("Export complete."); $('#exportButton').prop('disabled', false); }, function (reason) { // onError // User can catch the failure reason in this callback. console.log('The reason of save failure is ' + reason); $('#exportButton').prop('disabled', false); } );