csmcgcsmcg Posted March 15, 2019 Share Posted March 15, 2019 I am trying to pass a field name into a category expression in an HTML5 chart. This is needed as the category will change upon subsequent drill-down activity in the chart. Jaspersoft Studio 7.1.0Example: parameter DF1 contains the value "ACCOUNT" which is a field name in the dataset. $P{REPORT_SCRIPTLET}.getFieldValue($P{DF1}) compiles, does not throw an error, but returns nothing. $F{ACCOUNT} works as advertised. Any advice would be greatly appreciated. Regards Link to comment Share on other sites More sharing options...
Friendly User Posted March 19, 2019 Share Posted March 19, 2019 Hey!I am not sure what you mean here by dynamic category expression here. Category expressions are by definitions dynamic and will create you a category based on what the expression resolves to. Do you want to have something like $P! for your expression where first the parameter evaluates into some string with code and then that code is used as category expression? That wouldn't be possible, unfortunately, as the $P! syntax only works for queries. Link to comment Share on other sites More sharing options...
csmcgcsmcg Posted March 19, 2019 Author Share Posted March 19, 2019 Thansks for the response. I'll try to explain my goal from in a different way. The category expression for a chart is driven by a field name in a table or result set. example: $F{ACCOUNT_TYPE_DESCRIPTION}. I would like to be ablee to re-use the chart against a result-set and categorize via a parameter rather than the hard-coded field reference ie. "ACCOUNT_TYPE_DESCRIPTION" Regards. Link to comment Share on other sites More sharing options...
Friendly User Posted March 21, 2019 Share Posted March 21, 2019 That unfortunately is not possible unless you dynamically build the JRXML itself 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