var sheet = spread.getActiveSheet();
sheet.addRows(0, 1);
sheet.setRowVisible(0, false, GC.Spread.Sheets.SheetArea.viewport);
for (var col = 0; col < sheet.getColumnCount(); col++) {
sheet.setValue(0, col, sheet.getText(0, col, GC.Spread.Sheets.SheetArea.colHeader));
}
var fileName = 'export.csv';
let options = {
columnHeadersAsFrozenRows: false,
encoding: 'UTF-8',
rowDelimiter: '\r\n',
columnDelimiter: ',',
sheetIndex: 0
};
options.fileType = GC.Spread.Sheets.FileType.csv;
spread.export(
function (blob) {
saveAs(blob, fileName);
},
function () {},
options
);
sheet.deleteRows(0, 1); |