?
Solved

about odd and even row implementation with ireport

Posted on 2008-10-13
6
Medium Priority
?
1,855 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

801 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