spread 手动设置行数
需求如下:把取到的数据,以代码的形式写入spread中,然后导出到xls文件。
现在的问题写到501行时,报错:行index大于499,也就是说一个sheet只有500行,请问各位大佬,如何才能给sheet设置行数!谢谢!
开发工具:VB.net 2022 ,spread for window forms 15.0
代码如下:
For intI As Integer = 0 To dr.Length - 1
.Cells(4 + intI, 2).Value = clsStringMgr.FilterNull(dr(intI).Item(enumMSDataCol.GYOSHU_NM))
.Cells(4 + intI, 2).HorizontalAlignment = CellHorizontalAlignment.Center
.Cells(4 + intI, 3).Value = clsStringMgr.FilterNull(dr(intI).Item(enumMSDataCol.KEITAI_NM))
.Cells(4 + intI, 3).HorizontalAlignment = CellHorizontalAlignment.Center
.Cells(4 + intI, 4).Value = clsStringMgr.FilterNull(dr(intI).Item(enumMSDataCol.SIZE_NM))
.Cells(4 + intI, 4).HorizontalAlignment = CellHorizontalAlignment.Center
.Cells(4 + intI, 5).CellType = numberCellTypeDot
.Cells(4 + intI, 5).Value = clsStringMgr.FilterDec(dr(intI).Item(enumMSDataCol.SUM_WT))
.Cells(4 + intI, 5).HorizontalAlignment = CellHorizontalAlignment.Center
.Cells(4 + intI, 6).Value = clsStringMgr.FilterNull(dr(intI).Item(enumMSDataCol.BIKO))
.Cells(4 + intI, 6).HorizontalAlignment = CellHorizontalAlignment.Center
Next
参考
fpSpread1.ActiveSheet.RowCount = 1000;
页:
[1]