Cascading input controls in a report reduce a large number of choices to a manageable number. A single value chosen for a cascading input control determines which other values appear as choices for input. For example, the choice of a country determines which states or regions are listed as choices. For more information, see Selecting a Data Source for Running the Complex Report.
To run a report with cascading input controls:
1. | In the Search field at the top of any JasperReports Server page, enter cascading and click |
The search results are displayed in the repository.
2. | In the search results, click the name Cascading multi select example report. |
The report runs, and appears with the Options panel open on the left side of the Report Viewer
3. | In the Options panel’s Country multi select drop-down, select a different country, for example Mexico. |
The other drop-downs in the Input Controls dialog box are automatically updated with Mexican data.
Cascading input controls are implemented as queries that access the database to retrieve the new values. The server displays an activity monitor while the query is running, and in the case of long queries, you can click Cancel and select different values. |
4. | In the Cascading state multi select control drop-down, select a different state, for example Guerrero. |
The Cascading name single select drop-down is updated to list accounts in Guerrero.
Cascading Input Controls |
The report design defines country and state input controls as multi-select; users can Ctrl-click to select multiple values in such lists. |
5. | Click Apply to run the report with the chosen values. |
The report creates a list of all account names in the chosen states. The report lists the account name chosen in the Cascading name single select input control at the top.
As with simple input controls, you can save these Options settings as a new Report Version. To do this, click Save to open the Save Values dialog. Name the new version, then click Save.
Recommended Comments
There are no comments to display.