预算表二次开发相关说明
金蝶云社区-hua_yang
hua_yang
0人赞赏了该文章 1,198次浏览 未经作者许可,禁止转载编辑于2014年06月06日 16:17:07

经常有人咨询预算表的二次开发相关的逻辑,整理如下:
1、如何遍历报表里的单元格,并且判断单元格是否有项目公式?
Book _book = null;
Sheet _sheet = null;
Cell _cell = null;

String _tmpformulaStr = null;
int rowIndex = 0, rowCount = 0, colIndex = 0, colCount = 0;

_book = getBook();
for(int sheetIndex=0, sheetSize=_book.getSheetCount(); sheetIndex _sheet = _book.getSheet(sheetIndex);

rowCount = _sheet.getMaxRowIndex();
colCount = _sheet.getMaxColIndex();

for(rowIndex=0; rowIndex<=rowCount; rowIndex++) {
for(colIndex=0; colIndex<=colCount; colIndex++) {
_cell = _sheet.getCell(rowIndex, colIndex, false);

if (BgNFSHelper.checkHasFormulaOfCell(_cell)) {
_tmpformulaStr = BgNFSHelper.getFormulaOfCell(_cell);
}
}
}
}