Link to home
Start Free TrialLog in
Avatar of fabiogaravelli
fabiogaravelli

asked on

about odd and even row implementation with ireport

hi all,
can someone help me to create dinamic report with ireport...
How i can display alternate row color ?
Avatar of darkapple
darkapple
Flag of Nepal image

Use conditional style.

A conditional style has two elements: a Boolean condition expression and a style. The
style is used only if the condition evaluates to true.

We have following code snippet to get alternating row color.

In this example, element with this style will get red backcolor. But the presence of conditional style changes the behaviour and when rendered on an even row, the same element will have blue backcolor.

A conditional style override the properties of parent style.


Hope this helps..


<style name="alternateStyle" fontName="Arial" backcolor="red">
    <conditionalStyle>
        <conditionExpression>
                 new Boolean($V{REPORT_COUNT}.intValue() % 2 == 0)
        </conditionExpression>
        
        <style backcolor="blue"/>
    </conditionalStyle>
</style>

Open in new window

Avatar of fabiogaravelli
fabiogaravelli

ASKER

where i implement conditional style
ASKER CERTIFIED SOLUTION
Avatar of darkapple
darkapple
Flag of Nepal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
how i put the rectangle below the text field ?and the text field must have particular properties such transparent on so on ?
if you are using iReport for designing report file then you can draw a rectangle and send it to back.

Its like, you'll draw a rectangle in detail section, right click the rectangle and from the context menu send it to backward.
done thx