Solved

about odd and even row implementation with ireport

Posted on 2008-10-13
6
1,835 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 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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.

691 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