Apache Excel工作表移动的行数不超过有限的行数
我在“sheet”变量中有一个excel模板。我需要将数据库值添加到新行中,如图所示。我使用ApachePOI中的函数来编辑excel文件Apache Excel工作表移动的行数不超过有限的行数,apache,excel,apache-poi,Apache,Excel,Apache Poi,我在“sheet”变量中有一个excel模板。我需要将数据库值添加到新行中,如图所示。我使用ApachePOI中的函数来编辑excel文件 sheet.shiftRows(RowId, sheet.getLastRowNum(), Rows); 但添加的行数不超过16行。起初,页面高度似乎是1,因此不能超过一页,但即使使用 sheet.getPrintSetup().setFitHeight((short)9); 同样的错误也来了。知道为什么会这样吗 shiftRows函数的参数是15、25
sheet.shiftRows(RowId, sheet.getLastRowNum(), Rows);
但添加的行数不超过16行。起初,页面高度似乎是1,因此不能超过一页,但即使使用
sheet.getPrintSetup().setFitHeight((short)9);
同样的错误也来了。知道为什么会这样吗
shiftRows函数的参数是15、25、12谢谢。我发现错误是因为25行之后有空行。所以我创建了新行。
HSSFPrintSetup printSetup = sheet.getPrintSetup();
sheet.getPrintSetup().setFitWidth((short) 1);
sheet.getPrintSetup().setFitHeight((short) 0);
sheet.setAutobreaks(true);
printSetup.setLandscape(true);