Using variables, parameters, & fields from a sub data set in chart properties

2

In Ireport Professional 5, I have several charts that are generated by data in a sub dataset.  I would like to update chart properties based on the data in the sub data set that is filling the chart or other variables, parameters, fields, etc in that sub data set but I can't.  Is there anyway to access varables, parameters, or fields from a sub data set outside of that dataset or even just for the properties of the objects that are connected to the dataset?  

 

 

 

katelyn's picture
14
Joined: Feb 12 2013 - 1:04pm
Last seen: 6 years 4 months ago

Hi,

I am facing similar issue.
Any luck in finding solutuion or any work around?

kantheti.prajyodh - 2 years 2 weeks ago

Hi, I'm facing similar issue too:(

serhii.dakhnii - 1 year 10 months ago

4 Answers:

0

Hi,

When you create a chart with subdataset then you need to assign a Subdataset to that chart otherwise it will take a main dataset by default.

So when you assign a subdataset to a chart then whatever the parameter, variables and fields that you used is used for chart.

ajinkya_c's picture
976
Joined: Aug 29 2012 - 6:13am
Last seen: 2 years 4 months ago

But they aren't available for the styling of the chart. For example, if I try to use a subdataset field in a "Print when Expression" for a chart, I get an error saying the field is not found. Even if that subdataset is connected to that chart and is filling it with data. I want to be able to style the charts with variables, parameters, fields, etc from the subdataset.

katelyn - 6 years 4 months ago
0

If you are using parameters of subdataset in chart and it gives null values then check that you map parameters in the chart.

In chart properties where you set dataset for chart check that you map subdataset parameter with main dataset parameter.

May be if parameter not mapped then query in the subdatase gives null values for all fields and variables.

Let me know if yuo already done that.

ajinkya_c's picture
976
Joined: Aug 29 2012 - 6:13am
Last seen: 2 years 4 months ago
0

I do have a parameter in the subdataset that I have mapped to the main dataset within the chart data pop-up window.  The subdataset is not returning null for all parameters, fields, and variables because the chart correctly fills with data.  I just cannot use that data to alter the look and feel of the chart.  I can't use those fields, parameters, and variables for any of the chart's properties.  

"I try to use a subdataset field in a "Print when Expression" for a chart, I get an error saying the field is not found. Even if that subdataset is connected to that chart and is filling it with data. "

katelyn's picture
14
Joined: Feb 12 2013 - 1:04pm
Last seen: 6 years 4 months ago
0

I've solved this using the bucket properties. In expressions for bucket properties you are able to use subdataset fields. Here is a good example:

https://community.jaspersoft.com/wiki/dynamically-updating-bar-colors-ht...

serhii.dakhnii's picture
Joined: Sep 7 2017 - 7:44am
Last seen: 1 year 9 months ago
Feedback
randomness