Apache POI复制具有n次公式的行

我有一个6列和50k行的表。 我想复制一行n次。 现在我正在这样做:

for (int i=0; i<=excel_max_row; i++) { row = sheet3.createRow((short) i); cell = row.createCell(0); cell.setCellFormula("IFERROR(LOOKUP(Template!A"+(i+2)+",'Dropdown-Values'!A:A,'Dropdown-Values'!B:B),\"\")"); cell = row.createCell(1); cell.setCellFormula("IF(Template!B"+(i+2)+"=0,\"\",Template!B"+(i+2)+")"); cell = row.createCell(2); cell.setCellFormula("IFERROR(LOOKUP(Template!C"+(i+2)+",'Dropdown-Values'!C:C,'Dropdown-Values'!D:D),\"\")"); cell = row.createCell(3); cell.setCellFormula("IFERROR(LOOKUP(Template!D"+(i+2)+",'Dropdown-Values'!E:E,'Dropdown-Values'!F:F),\"\")"); cell = row.createCell(4); cell.setCellFormula("IFERROR(LOOKUP(Template!E"+(i+2)+",'Dropdown-Values'!E:E,'Dropdown-Values'!F:F),\"\")"); cell = row.createCell(5); cell.setCellFormula("IF(Template!F"+(i+2)+"=0,\"\",Template!F"+(i+2)+")"); } XSSFFormulaEvaluator.evaluateAllFormulaCells(wb); 

它的工作原理很慢,因为excel_max_row可以达到50k。 有没有办法快速复制连续n次所有的Forumals?

非常感谢

我在用户打开文件时评估所有公式:

 wb.setForceFormulaRecalculation(true);