明明spreadjs中有数据但是却显示rowcount为-1
代码:
updateSheetRowCountAndColCount() {
if (!this.workbook) {
return
}
let sheetCount = this.workbook.getSheetCount()
for (let index = 0; index < sheetCount; index++) {
let sheet = this.workbook.getSheet(index)
console.log(sheet.name());
let usedRange = sheet.getUsedRange(GC.Spread.Sheets.UsedRangeType.data)
console.log(usedRange);
// console.log(usedRange.colCount, usedRange.rowCount)
if (usedRange) {
let ColCount = usedRange.col + usedRange.colCount + 23
let RowCount = usedRange.row + usedRange.rowCount + 40
sheet.setColumnCount(ColCount, GC.Spread.Sheets.SheetArea.viewport)
sheet.setRowCount(RowCount, GC.Spread.Sheets.SheetArea.viewport)
} else {
sheet.setColumnCount(23, GC.Spread.Sheets.SheetArea.viewport)
sheet.setRowCount(40, GC.Spread.Sheets.SheetArea.viewport)
}
}
},
|