I'm starting with Jasper Reports and I have a use case that I'm finding difficult to solve. The report I want to design should be like this:
|Account 1||Account 2||...||Total|
Where Column Headers are dynamic depending on the number of Accounts defined and the three Row Headers (Previous Balance, Income, Expense) will always show in the report even if some Account has a nullor 0value in any of them. The Balance at the end would be the result of Previous Balance + Income - Expense
I first watched how Crosstab works as the report is a matrix where I can get the Total in any of the two ways (through sum of Balances or applying the Balance formula to the Total column), but what I'm not understanding is how could I make the Rows headers fixed. Should I use some variable that I set by hand? Any hint on what to read will be a great help.
The other approach I suppose it would be feasible is using a table where the row headers of the diagram would be the columns and Accounts the rows. Balance is easily defined same as total. The only thing I don't know if it's possible is turning the columns to rows and viceversa (transposing the table). What do you think, is this approach better? If so, is it possible to transpose the table? what's the JRXML attribute to do so?