views:

27

answers:

0

I would like to like to produce a Excel spreadsheet using DynamicJasper that computes subtotals of columns using formulas. For example:

Employee   Department        Expenses
----------------------------------------
Alice      Sales             $600.00
Bob        IT                $400.00
Charlie    IT                $450.00

           Sales subtotal    $600.00 
           IT subtotal       $850.00

I want the bottom two rows to be produced in such a way that the numbers are the result of Excel formulas, so that if the hours were edited, the subtotals would change.

I'm encountering various difficulties currently. If I set the Expenses column to have type double, then DynamicJasper inserts $ and makes it a string. (Thus addition becomes impossible.) But a more basic problem is how to define a cell to be a subtotal of cells above it.

I would be pleased if anyone could point me towards an example that simply totaled a column, so long as it used excel formulas to accomplish it.