解决了。。。。。脑袋没有转过弯来
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 = fileName;
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); |