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?
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.
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.
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. "
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: