13.07.2015 Views

iReport Ultimate Guide - Nimsoft Library

iReport Ultimate Guide - Nimsoft Library

iReport Ultimate Guide - Nimsoft Library

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>iReport</strong> <strong>Ultimate</strong> <strong>Guide</strong>A style can have an arbitrary number of conditional styles. A good example of this would be designing your report to display aparticular field in a different color (let’s say depending on the total number of orders placed). You would set the foregroundcolor as red in the base style, then add a conditional style to be used when the variable $V{total_orders} is less that 5 forwhich the color would be red, another conditional style with the foreground color set to yellow when the same value isbetween 6 and 10, and green for another conditional style for a number of order greater than 20.Figure 8-15Alternated color for each rowLet’s see an example of using a conditional style to achieve the effect of having an alternating background for each row. Theeffect is shown in Figure 8-15.The trick is pretty simple. The first step is to add a frame element in the Detail band. The frame will contain all the elements ofthe band, so we are using the frame as if it were the background for the band itself; in fact, the frame should take all the spaceavailable in the band. Then all the textfields will be placed inside the frame (see Figure 8-16 and Figure 8-17).Figure 8-16All the elements are placed inside the frameFigure 8-16 does not reflect the real design, I just tried to project the idea that the textfields showing the real data are inside athe frame that covers the entire surface of the band.134

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!