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

Dynamic Category Expression in HTML5 Chart


csmcgcsmcg

Recommended Posts

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

Example: 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

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

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

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

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