Jump to content

Conditional formating used in Crosstab does not work


Recommended Posts

Hi folks,

I have a defined custom style at report level with an condition which is based on field from query:

    <style name="Crosstab Data Text" mode="Transparent" hAlign="Center">        <conditionalStyle>            <conditionExpression><![CDATA[new Boolean( $F{TYP_HH} == 'D' )]]></conditionExpression>            <style mode="Opaque" forecolor="#FFFFFF" backcolor="#FF9999"/>        </conditionalStyle>    </style>[/code]



When I use this style for any field in report (outside crosstab), then it works fine. But I would like to use it within Crosstab. A problem is, that when a report is compilled an error occurs:


net.sf.jasperreports.engine.design.JRValidationException: Report design not valid : 
     1. Field not found : TYP_HH


Style evaluation at report level is set to TRUE:

<property name="net.sf.jasperreports.style.evaluation.time.enabled" value="true"/> [/code]

Any idea or trick how to apply conditional formatting within Crosstab?




Link to comment
Share on other sites

  • 1 year later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • 4 months later...

It's just because when the style is use in the report you have to use $V instead of $F to defined the condition.

Because in the crosstab, it's variables that are used instead of fields.

If you when to used same style in and out of the crosstab, create to different style.



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