Jump to content

Grouping in SUBDATASET


chetan_33

Recommended Posts

for jasper1.2.5 and iReport1.2.5

While defining Sub datasets through iREPORT

we get to see Group & Properties button besides the field, parameter and variable buttons

Does anyone know what this group is for and hwo it is to be used.

I was not able to figure it the cross tab samples of jasper

  • Like 1
Link to comment
Share on other sites

Subdatasets are able to group the rows coming from their data source into groups and compute totals per group.

 

Subdatasets can be used both for crosstabs and for charts. Defining a group in a subdataset makes more sense for charts, as crosstabs can perform bucketing/summing on its own.

 

Also note that in some cases (e.g. SQL query result data sources) you can perform the grouping and summing in the data source of the subdataset, while in other cases (e.g. CSV or bean data sources), you can't (you need to write custom data sources to group and sum the data).

 

You can see a chart using a subdataset in demo/samples/charts/SubDatasetChartReport.jrxml

 

HTH,

Lucian

  • Like 1
Link to comment
Share on other sites

Unfortunately, there is no such sample. But it is the same principle as for charts, so by looking at the chart sample you can easily adapt it for a crosstab.

 

And again, using subdatasets with groups for crosstabs is not very common since you can do all the grouping and summing inside the crosstab itself. Why do you think you need subdataset groups for your crosstab?

  • Sad 1
Link to comment
Share on other sites

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...