mmceldow Posted December 4, 2019 Share Posted December 4, 2019 For Jasperserver I need to be able to have two parameters for the report to be based on querys, and I need the results of the second parameter "lookup" to be based on the results of the first parameter value. I know it sounds confusing, so here is an example.I have multiple facilities (buildings), and in each facility there are multiple locations (departments). I want to first select facility A from the first parameter, then have the second parameter only have locations from facility A (filtered)FacilitiesLocationsADoctor JonesDoctor SmithBDoctor WalkerDoctor BrownSo when I select "A" for my facility in the first parameter, I want to only see "Doctor Jones" and "Doctor Smith" in the second parameter, not all 4 doctors.I know how to do the query based parameter from this excellent, post:https://community.jaspersoft.com/questions/542182/selecting-parameter-values-sql-querybut I need to take it just one step further. Anyone know how to do this? Thanks,Mike Link to comment Share on other sites More sharing options...
hal_1 Posted December 8, 2019 Share Posted December 8, 2019 I believe jasper refers to this as cascading parameters. Are you running your reports from Jasper Server or have you integrated your reports to be executed from a web-based application? I have found that cascading parameters work great when executing reports directly from Jasper Server but not when the reports are executed from within an application. Also, I use the community edition of Jasper Server, so that may make a difference. The second parameter query will need to have the first parameter included in the query after it is selected to narrow down the list for the 2nd parameter. Link to comment Share on other sites More sharing options...
mmceldow Posted December 9, 2019 Author Share Posted December 9, 2019 I am running the reports from Jasper Server, and I too use the community edition. Thanks for your reply. I hadn't tried including the first parameter in the second query yet, I didn't now if it would be that simple. Sometimes even the simple things seem to be hard to accomplish easily with this software :) Mike Link to comment Share on other sites More sharing options...
Solution mmceldow Posted December 23, 2019 Author Solution Share Posted December 23, 2019 Many thanks to @hal_1. Cascading parameters worked perfectly in my situation. I simply used a "$P{}" tag in the second input's query and it updates as the selection in the first control changes.Mike Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now