Showing posts with label How to create a multiple column with varying no of records report in Ireport ?. Show all posts
Showing posts with label How to create a multiple column with varying no of records report in Ireport ?. Show all posts

How to create a multiple column with varying no of records report in Ireport ?

Developers often need to design a report in a single page with multiple column and also each column containing varying number of records.
For Example

Report to show students performance in various sections
Section A Section B Section C Section D Section E

1 Shyam 100 1. Sundar 30 1. Nirmal 30 1 Aisha 50 1. Amu 98

2. Gowtham 200 2. Vimal 30 2. Teena 30 2. Dave 20

3. Sam 50


One can use Ireport Cross Tab options to achieve this. But the following way will be more easier way to achieve this.
1.First create a Subreport with following fields
Sno , Name of the student
2.In the main report add this subreport 5 times in different name .
3.Make sure the datasource for each subreport has to be passed as parameters from Master report.
4.When invoking from these reports from Java Application pass the data source to the corresponding parameters.
5.Compile the Master report and subreports.
6.Place all the compiled jasper files in same package.
Page copy protected against web site content infringement by Copyscape