Conditional formating used in Crosstab does not work

0

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>

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"/>

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

Thanks,

Tomas

tkepic's picture
9
Joined: May 30 2010 - 2:15am
Last seen: 2 years 8 months ago

Hi Tomas,

Did you find any answer for this?

pavan.elthepu - 4 years 6 months ago

1 Answer:

0

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.

Regards,

Eric.

ericfraselle's picture
Joined: Sep 11 2007 - 4:26pm
Last seen: 3 months 3 weeks ago
Feedback