Creating Table Components from a Domain Datasource
This is a guide on creating a domain based report with a Table Component from a Domain query.
SubDataset
You will need a Sub Dataset based on a Domain query. There is no "wizard" in iReport to achieve this so you'll need to make sure that you've got a query written, possibly by using the Domain based Report wizard.
Create the subdataset
Change the Query language to domain and paste your query in from the main report.
Create the Fields
Then you need the fields in the table component. For this example I just copy them and paste them from the main dataset:
Any Parameters that you are going to pass from the report (such as Input Selects) will need to be copied into the table componentarea as well. A simple copy & paste will accomplish this. If you are passing variables into the table you'll have to copy those, but if you are using them only locally within the table you can create them in the table component without creating them in the report component.
Create the Table Component
Drag in the table component. Set the Connection/Datasource Expression:
This step is critical, set the Parameters Map Expression to $P{REPORT_PARAMETERS_MAP}:
Any parameters that you are passing in will need to be mapped in addition to setting the Parameters Map Expression.
Example Report
Here's an example JRXML showing the above: Example Report It uses the "simple-domain" that ships with JasperReports Server
Recommended Comments
There are no comments to display.