Hi,
I am trying to style a cross tab based on data that is read in. I am using Jaspersoft Studio to edit the report.
I have found I can change the background color of a textfield in the crosstab like this
<reportElement style="Alt_Color" x="0" y="0" width="60" height="20" uuid="1285034f-6b3e-4181-bcdd-4d2e5ff03102">
<propertyExpression name="net.sf.jasperreports.style.backcolor"><![CDATA["#EEEEEE"]]></propertyExpression>
</reportElement>
And I can put in a parameter in the place of the color and that works when I put in a value in the parameter.
What I would like is to use a field value read in from the data in place of the current color I have specified. The problem is I can't seem to use field variables in this location. It says it can't be found.
Is there a way to pass field variables to a crosstab? Can a field variable be made into a parameter and then passed to the crosstab?
Been trying for quite a while and can't seem to figure it out.
Thanks
1 Answer:
Crosstabs display aggregated data and one cell can correspond to several records in the data source. For that reason field values cannot be used directly in crosstabs, you need to pass field values as crosstab groups and use the group variables to display the values. You can also use crosstab parameters but only when there is a single value to be passed, that is when the value does not change from one row/column to another.
Regards,
Lucian