请参考下面的代码
- var spread = new GC.Spread.Sheets.Workbook();
- spread.setSheetCount(1);
- var sheet = spread.getSheet(0);
- sheet.setDataSource(yourJSONData);
- var json =spread1.toJSON( { includeBindingSource: true } )
- // here is excel IO API
- excelIo.save(json, function (blob) {
- saveAs(blob, fileName);
- }, function (e) {
- // process error
- console.log(e);
- }, {password: password});
复制代码 |