Jump to content
Changes to the Jaspersoft community edition download ×

Dynamically modifying query


andersonf

Recommended Posts

I'm trying to modify my query before it's executed based on user parameters, but not just by inserting the parameter.

 

For example, if the user enters in the value "product" for the parameter "groupBy" I want to have my query select the field "product_name.description". Obviously I can't do this solely with the $P!{sortBy} substitution, since I need to do some processing on the parameters beforehand.

 

I've tried modifying the parameterMap in the beforeReportInit method of a scriptlet, but it seems like either my modifications aren't being picked up, or the report query has already been executed prior to the beforeReportInit call, since my modifications have no effect.

 

So, is there a way to dynamically modify a query with more flexibility than the $P!{} parameter substitution, or will I have to do some out of band processing on the parameters before I invoke the jasper engine?

 

Thanks.

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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...