Kuhns, John <jkuhns <at> AimNTLS.com> writes: > > What is the proper way to add a TotalsRow to an XSSFTable? I can get an empty TotalsRow, but when I try to add a > function Excel complains and removes the total row. Thanks! > > > Sent via the Samsung Galaxy S™II Skyrocket™ an AT&T 4G LTE smartphone. >
After creating a new row, I add a formula to a cell like this: ...other code... workString = "sum(G" + firstStyleRow + ":" + "G" + (rowIndex) + ")"; cell.setCellType(Cell.CELL_TYPE_FORMULA); cell.setCellFormula(workString); ...other code... and don't forget to refresh the formulas such as: XSSFFormulaEvaluator.evaluateAllFormulaCells(workbook) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
