Jump to content
Changes to the Jaspersoft community edition download ×

Dynamic Element Formatting


chandu_517

Recommended Posts

Hi all,

I'm new to ireports. I require the font style for data to be displayed dynamically based on some condition which is explained below.

I have three Fields x,y,z to compare. if x < y or  x>z  then the data color for x should be changed to 'red' else data color of x should be in black color.

please advice me as to how to proceed on this & where to validate.This requriement is for a swing window application.

Thanks in advance

Regards,

Chandu

 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi Chandu,

which version of iReport do you use? In version 3.6.0 you'll find the Styles in the Report Inspector. There you have to add a Style (the way the field normally should look like) by right clicking on the word "Styles". After that you can add a conditional style.

HTH

Christina.

Link to comment
Share on other sites

Hi Christina,

have you information about parametric styles?

with "parametric" I mean styles that accept parameter for background colors, font dimension etc...

i.e.:

        <conditionalStyle>
            <conditionExpression><![CDATA[new Boolean ($F{COL4}.matches("ddd"))]]></conditionExpression>
            <style
                name="AlternativeStyle"
                isDefault="false"
                backcolor="$P{aColor}"
                fontSize="$P{aValue}"
            />
        </conditionalStyle>

 

so, aColor, aValue can be read from a DB or passed to the report dinamically...

thanks...

 

 

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