Solved

about odd and even row implementation with ireport

Posted on 2008-10-13
6
1,789 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
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 …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

760 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

16 Experts available now in Live!

Get 1:1 Help Now