Jump to content
Changes to the Jaspersoft community edition download ×

Crosstab Example Using Collections

Recommended Posts

By: jchavezb - jchavezb

Crosstab Example Using Collections

2006-01-12 14:12



Is there an example jrxml file for setting up a crosstab report where the main collection of primary objects fills the report and each detail, i.e., the crosstab, is rendered from a second collection that is a property of the primary object?


Basically, I'm looking to build a dynamic (at runtime) number of columns (days)i.e. for a dynamic number of rows (users). However, the number of columns is the same for each row in a given report.


The examples I have seen use a secondary dataset with an incoming parameter from the current iteration of the primary dataset to grow horizontally.


Thanks in advance. Please advise is I should provide more detail. JasperReport rocks!


- jchavezb







By: Lucian Chirita - lucianc

RE: Crosstab Example Using Collections

2006-01-16 04:22



I don't know of any such example, but what you need to do is this:

- create a sub dataset that has the fields of the second collection

- define your crosstab with a dataset like this:



<datasetRun subDataset="<sub dataset>">

<dataSourceExpression>new JRBeanCollectionDataSource($F{<collection field>})</dataSourceExpression>




Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...