Hello Guys! Today We learn how to design the Jasper Report by using Table Component. We will see this process of using table component in step by step process.

1. First We will open the blank iReport, then drag and drop the table component in the detail band portion on the open iReport screen.

2. On the drop of table component on iReport window , you will get one dialog box on screen. In this dialog box, you have to select the empty table option, column numbers (According to your requirment) on first wizard and empty data source option on second wizard and you can select the table header,table footer,column header,column footer and other options on the final wizard.

3. Now you have to work on design of table and set the header of table by using “Static Text” component on Tool Box Of iReport and also set the record field by adding “Text Field” component.

4. After the completion of view part of table on Jasper Report, you have to decalre the field name same as to Domain field names on the .jrxml file as following manner.

(This field value will be pass as a arraylist or map in the report definition(In JasperReportDef class object) on the generation time of JasperReport).Like this.

Note – Here questions is arraylist.

5. In the tag

You have to specify the “REPORT_DATA_SOUCE” on name attribute.

6. In the next step you have to specify these field names on the given dynamic “Text Field” on the table view.

7. The complete code of .jrxml file is –

8. Final view will be pdf file as Jasper Report.

Hope this help.. 🙂