I am attempting to generate a cross tab report using JasperReports
. The column contains time periods and the row contains different group by conditions. Now I need to change the styling of the row headers based on the level. For example, in the grid shown below, web and email need to be in bold while the other row headers are as is.
Now, I have a field in the bean that lets me decide if I should make the text bold or not, so I tried to use this in a conditional style as below
<style name="rowStyle" hAlign="Center">
<conditionalStyle>
<conditionExpression><![CDATA[$V{level}.intValue() != 0]]></conditionExpression>
<style isBold="true" hAlign="Left"/>
</conditionalStyle>
<conditionalStyle>
<conditionExpression><![CDATA[$V{level}.intValue() == 0]]></conditionExpression>
<style isBold="false" hAlign="Right"/>
</conditionalStyle>
</style>
and I have a field and a measure expression corresponding to this
<field name="level" class="java.lang.Integer"/>
<measure name="level" class="java.lang.Integer">
<measureExpression><![CDATA[$F{level}]]></measureExpression>
</measure>
However this style does nothing when used inside the crosstabRowHeader
, it takes effect only inside crosstabCell
.
So my questions are
- Is anyway for me to use a conditional style inside the crosstabRowHeader?
- More specifically, can I access any bean property within the crosstabRowHeader?