Excel转Html(十一)--POI处理Excel-获取sheet总行数-总列数-行高-列高

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u014677702/article/details/84677151

获取sheet行总数:sheet.getLastRowNum()
列总数:dataMap.get("maxColNum-" + form.getFormName() 获取列最多的行,特别注意:sheet.getRow(0).getPhysicalNumberOfCells()不准确

行高:rowHeight = row.getHeight() / 15
列宽:
if (rowIndex == 0) {
colWidth = 2 * sheet.getColumnWidth(cellIndex) / 60;
if (colDefaultWidth != colWidth) {
colWidths.append(",").append(cellIndex).append("-").append(colWidth);
}
}

猜你喜欢

转载自blog.csdn.net/u014677702/article/details/84677151