• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1952
  • Last Modified:

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 ?
0
fabiogaravelli
Asked:
fabiogaravelli
  • 3
  • 3
1 Solution
 
darkappleCommented:
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

0
 
fabiogaravelliAuthor Commented:
where i implement conditional style
0
 
darkappleCommented:
apply style to element. an element may be a rectangle drawn in detail section of report. remember to send the rectangle below the text.

0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
fabiogaravelliAuthor Commented:
how i put the rectangle below the text field ?and the text field must have particular properties such transparent on so on ?
0
 
darkappleCommented:
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.
0
 
fabiogaravelliAuthor Commented:
done thx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now