[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

about odd and even row implementation with ireport

Posted on 2008-10-13
6
Medium Priority
?
1,894 Views
Last Modified: 2012-05-05
hi all,
can someone help me to create dinamic report with ireport...
How i can display alternate row color ?
0
Comment
Question by:fabiogaravelli
  • 3
  • 3
6 Comments
 
LVL 9

Expert Comment

by:darkapple
ID: 22708389
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
 

Author Comment

by:fabiogaravelli
ID: 22708973
where i implement conditional style
0
 
LVL 9

Accepted Solution

by:
darkapple earned 2000 total points
ID: 22709345
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:fabiogaravelli
ID: 22709429
how i put the rectangle below the text field ?and the text field must have particular properties such transparent on so on ?
0
 
LVL 9

Expert Comment

by:darkapple
ID: 22709899
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
 

Author Comment

by:fabiogaravelli
ID: 22709979
done thx
0

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses
Course of the Month19 days, 8 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question