Posted 10 April 2018, 11:02 am EST
Hello,
You would need another Spread instance to hold the JSON before exporting to Excel and then removing the data from it. You can keep the other spread instance hidden.
Please refer to the code below:
$("#saveExcel").click(function () {
var serializationOption = {
ignoreFormula: false,
ignoreStyle: false,
columnHeadersAsFrozenRows: true,
includeBindingSource: true
};
var fileName = "export.xlsx";
if (fileName.substr(-5, 5) !== '.xlsx') {
fileName += '.xlsx';
}
var json = spread.toJSON(serializationOption);
spread1.fromJSON(json);
var activeSheet = spread1.getActiveSheet();
activeSheet.clear(1, 0, 10, 10, GC.Spread.Sheets.SheetArea.viewport, GC.Spread.Sheets.StorageType.data);
var myjson = spread1.toJSON();
// here is excel IO API
excelIo.save(myjson, function (blob) {
saveAs(blob, fileName);
}, function (e) {
// process error
console.log(e);
}, {
});
});
I hope it helps.
Thanks,
Deepak Sharma