Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iReport: Passing parameters from a main report query to a dataset query for a table or list

Tags:

I understand how to pass parameters from a main report to a subreport, since there's a specific field for this in the subreport object. However, I'd like to do the same thing with a table or list object as a consumer (rather than a subreport). Is it possible?

For example, say I have a parameter of 'customerID' that I can populate with a main report query, but I can't seem to pass this parameter to the table's dataset's SQL query.

I've tried, and continue to try, various combinations of parameters, fields, and variables, but to no avail.

Does this sort of thing require a subreport implementation?

(If it matters and isn't obvious, I'm using JDBC)

like image 535
todb Avatar asked Sep 10 '10 01:09

todb


People also ask

How do you use parameters in iReport?

Parameters promptDrag the parameter from the report inspector inside the title band. iReport creates a textfield to display the parameter value. Run the report using an empty data source by clicking the preview button. The parameter prompt dialog will appear asking for a value for the MESSAGE parameter.

How do you pass parameters to subreport in iReport?

If you are using iReport to create reports then open the main report in iReport and select Subreport and go to the property section of the report, click on Parameters property and click on Copy from master tab. From there you can select the parameters which you want to pass to the sub report. Highly active question.


1 Answers

To pass the parameters from main report to the table or list datasources in the iReport 3.6.7+, you need to do following steps:

1) create required parameters in the main report by right clicking on the parameters section of main report------> add parameter-------->set the properties (data type) of newly added parameter to your desired one.

2) create equivalent parameters in the table/List's data source's parameters section exactly as in step 1.

3) from report explorer, right click on the table and click on Edit Table DataSet ------> Select the parameters tab ----------->Click on add ---------->Choose the parameter (which you created in the dataset's parameter section in step 1) from upper combo (i.e. Dataset parameter name) ------> then click on lower button (i.e.) assign value expression i.e. the params which you added in step 1.

source : http://hamroblog-sristi.blogspot.fr/2011/04/passing-parameters-from-main-report-to.html

like image 135
Ouadie Avatar answered Oct 27 '22 16:10

Ouadie