Jump to content
We've recently updated our Privacy Statement, available here ×

SOLVED - Selecting parameter from another parameter that is selected by a query


mmceldow
Go to solution Solved by mmceldow,

Recommended Posts

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)

FacilitiesLocations
ADoctor Jones
Doctor Smith
BDoctor Walker
Doctor Brown

So 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-query

but I need to take it just one step further.

 

Anyone know how to do this?

 

Thanks,

Mike

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

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

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

  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...