andersonf Posted November 9, 2006 Share Posted November 9, 2006 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 More sharing options...
teodord Posted November 15, 2006 Share Posted November 15, 2006 Hi, Use the <defaultValueExpression> of some dummy report parameters for which you never supply a value.They will make the computation you need before altering the query. I hope this helps.Teodor 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