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.

SubdatasetsCHAPTER 15 SUBDATASETSReport generation is based on a single data source, such as a query, a collection of JavaBeans, or an XML file. With a chart ora crosstab, this might not be sufficient, or it might simply be easier to retrieve data using a specific query or, in general, usinganother dataset. In a similar vein, you can use a subdataset to provide a secondary record nested within a report (performing anadditional query using a new data source or even the same connection that is used to fill the master report). Currently, you canuse a subdataset to fill Chart, Crosstab, and List elements, but a developer may be able to use it in other ways by creating acustom component.You can have an arbitrary number of subdatasets in a report. Each one has its own fields, variables, and parameters and canhave a query executed as needed. The dataset records can be grouped in one or more groups (like in a main report); thesegroups are used in subdataset variables.A subdataset is linked to its element by means of a dataset run. The dataset run specifies all the information needed by thesubdataset to retrieve and filter data and to process the rows used to fill the element.This chapter has the following sections:• Creating a Subdataset• Creating Dataset Runs• Working Through an Example Subdataset15.1 Creating a SubdatasetTo create a new subdataset, right-click the root node in the outline view and select Add Dataset from the context menu (seeFigure 15-1).299

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

Saved successfully!

Ooh no, something went wrong!