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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Lists, Tables, and BarcodesFor your convenience, <strong>iReport</strong> synchronizes the Item Height with the height of the List element when the list in the documentis resized. This feature is a way to suggest that you set the size of the List element to the same size of a virtual cell that willrepeat itself vertically, based on the data provided. If the Item Height is set to a different value (and lower than the elementheight), the item size will be represented in the designer by a dotted line (Figure 14-2).Figure 14-2Item height is shown when it is less than the element heightAt this point, we have placed the List element in a band and we have configured the subdataset and dataset runs, so it’s time toadd some content. All the elements placed inside a List element must be contained inside the Item Height. This is why <strong>iReport</strong>synchronizes the element height with the item height. In this way, the magnetic effects in the designer will help to position allthe elements without breaking any design rules. Figure 14-3 shows a completed List element.FrameList elementTextfieldsFigure 14-3Complete list elementThe List element is placed inside a Frame, which in this case is used to draw a border. The element contains two textfields. Thefirst ($F{SHIPCOUNTRY}) shows the name of a country, the second ($F{C}) shows the number of orders placed in thatcountry. To populate the element, we are using a query which we have seen several times in this manual:select count(*) c, shipcountry from ordersgroup by shipcountry order by shipcountryThe query selects the number of orders placed in each country and the related country name. Figure 14-4 shows the finalresult.279

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

Saved successfully!

Ooh no, something went wrong!