Hello,
I am working on a project where we are using jasper reports for displaying charts and tables. I am having this issue when I generate report in JasperStudio multiple pages are generated for one report.
For example I want to display query results as Chart. I have no issues with generating the chart, but whenever I run the report it always generates multiple pages. In fact report is generated on number of pages how many rows query returns.
If query retunrs 3 rows, 3 pages are generated with the same chart. If query retunrs 10 rows, 10 pages are generated and so on. Having this issue causing another issue when I want to add crosstab in the report. So when I try to add crosstab for the sam query, corss tab is displayed across all the pages, but for each page one colum of the crosstab is displayed.
For example. I have following result.
total | avg | month |
---|---|---|
23 | 3 | June |
73 | 3 | July |
22 | 12 | August |
43 | 2 | September |
If I try to display such a data set using chart and crosstab it will generate 4 pages. On each page chart will be same, but for the crosstab each column will be displayed in separeta page.
Any suggestions what is causing this issue?
3 Answers:
This usually happens when a chart is placed in the detail band and using the main dataset.
Try placing the chart in the summary band and creating a subdataset. Check the following tutorial.
https://community.jaspersoft.com/wiki/creating-charts-and-datasets-jaspersoft-studio
Please refer to this wiki article for a sample report design.