On 27/02/2012 11:06, Yegor Kozlov wrote:
Calling setCellType is extra in both cases. Cell.setCellFormula automatically changes the cell type to CELL_TYPE_FORMULA and setCellValue to the appropriate time.Is POI slow with replacing any formulas or only when setting your special ones: you mentioned that your formulas are complex and it might be the case. You can estimate parsing time by calling the formula parser explicitly: Ptg[] ptgs = HSSFFormulaParser.parse(formula, workbook); Are you sure it is the bottleneck?
Tried some variations, been unable to test explicit formula parsing, but the "setCellFormula()" seems to be the bottleneck. If I remove some of the formula from my template, speed improves, but anyway speed degrades as it processes more rows, so the problem is not in the complexity of the formulas, but it's something related in general to formula processing. I'm running out of ideas... Raffaele C. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
