poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Terry Birch <tjfbi...@bellsouth.net>
Subject Re: Excel TotalsRow
Date Wed, 07 Oct 2015 13:00:27 GMT
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: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Mime
View raw message