Solved

about odd and even row implementation with ireport

Posted on 2008-10-13
6
1,801 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 500 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
hibernate example for saving data 19 37
jboss wildfly 10.1 10 75
comma true 6 32
PHP not parsing ' character 12 37
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

815 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now