Jump to content
We've recently updated our Privacy Statement, available here ×

Problem Conditionally showing Fields


carlosan22

Recommended Posts

Hi Every one, this i think is my first post in here. Always i find a solution to my problems with jasper, unless that was my fault :laugh:.

 

Im workin with jasperreports/ireport 2.0.5, and i have a problem when i want to print a field with a different color when an expression becomes true, the fields are one in the top of another, overlaped. When i run the report in the JRViewer or in a pdf file or in Java 2d preview, it works fine the field appears and disappears as planned, but not so in an excel file or a html file just dont appear, the only way is not to overlap the fields, but i cant do it because they must be showed in conditionally in same place, what i can do?

 

Thanks in advance

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Use a conditional style for the text field:

Code:

<style name="CondStyle">
<conditionalStyle>
<conditionExpression><![CDATA[..condition..]]></conditionExpression>
<style forecolor="red"/>
</conditionalStyle>
</style>
...
<textField>
<reportElement ... style="CondStyle"/>
...
</textField>

 

HTH,

Lucian

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