const fromSheet = this.spread.getSheetFromName("单位工程数据库");
const toSheet = this.spread.getSheetFromName("单位工程计价");
const table = fromSheet.tables.find(0, 0);
const table2 = toSheet.tables.findByName("单位工程计价");
const range = table.dataRange();
//复制数据
let fromRange = [
new GC.Spread.Sheets.Range(1, 0, range.rowCount, range.colCount),
];
let toRanges = [
new GC.Spread.Sheets.Range(1, 0, range.rowCount, range.colCount),
];
this.spread.commandManager().execute({
cmd: "clipboardPaste",
sheetName: "单位工程计价", //复制到那个表的表名
fromSheet: fromSheet,
fromRanges: fromRange, //哪里来
pastedRanges: toRanges, //哪里去
isCutting: false,
clipboardText: "",
pasteOption: GC.Spread.Sheets.ClipboardPasteOptions.all,
});
//调整范围
toSheet.tables.resize(
table2,
new GC.Spread.Sheets.Range(0, 0, range.rowCount + 1, range.colCount)
);
|