Jump to content
Changes to the Jaspersoft community edition download ×

Crosstab shows nothing


thanapolr

Recommended Posts

Hello,

I try to use crosstab to show data from javabean.

My bean, PerformanceData, has four fields, "month", "week", "category", "subcat", and "data".

I use "month" and "week" as a row group, and use "category" and "subcat" as a column group.

 

The problem is my crosstab in the report doesn't show anything. I have already set the compatibility to 1.2.0 version.

 

The following is my code.

Code:

...

PerformanceData[] dd = new PerformanceData[2];
for (int i=0; i< dd.length; i++)
{
dd = new PerformanceData();
dd.setData ((float)i);
}
dd[0].setMonth ("month0"«»);
dd[0].setWeek ("week0"«»);
dd[0].setCategory ("cat0"«»);
dd[0].setSubcat ("sub0.0"«»);

dd[1].setMonth ("month1"«»);
dd[1].setWeek ("week1"«»);
dd[1].setCategory ("cat1"«»);
dd[1].setSubcat ("sub1.1"«»);

JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(Arrays.asList (dd));

jasperPrint = JasperFillManager.fillReport (jasperReport, parameters, dataSource);

JasperViewer.viewReport (jasperPrint, false);

 

My .jrxml is in an attached file

[file name=test2.jrxml size=21907]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/test2.jrxml[/file]

 

Thank you,

Thanapolr

Post edited by: thanapolr, at: 2006/08/15 11:30

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Why did you create a subdataset in your report? Your crosstab uses data from the subdataset you specified, but you don't pass any datasource to the subdataset and therefore there will be no data for the crosstab.

 

This is what you should do:

remove the subdataset

remove the dataset run from the crosstab dataset

move the crosstab in the summary section

[/ul]

 

HTH,

Lucian

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