iReport Ultimate Guide - Nimsoft Library

iReport Ultimate Guide - Nimsoft Library iReport Ultimate Guide - Nimsoft Library

13.07.2015 Views

iReport Ultimate GuideFigure 12-5The Chart Details windowIn this window you can select the data to use in order to create the chart.11. In the Type of Dataset combo box, select Pie dataset.This combo box allows you to specify the dataset types to generate the graph. Usually one dataset type is available, exceptwhen generating an XY Bar chart.12. In the Dataset tab, you can define the dataset within the context of the report. Specifically, Reset Type and Reset Groupallow you to periodically reset the dataset. This is useful, for example, when summarizing data relative to a specialgrouping. Increment Type and Increment Group specify the events that determine when new values must be added to thedataset.By default, each record of the dataset used to fill the chart corresponds to a value printed in the chart. Thisbehavior can be changed, forcing the engine to collect the data for the chart at a specific time (for instance, every time theend of a group is reached).The Increment When expression area allows you to add a flag to determine whether to add a record to the record setdesigned to feed the chart. This expression must return a Boolean value. iReport considers a blank string to mean “add allthe records.”For the purposes of this example, set the Reset Type to Report since you don’t want the data to be reset, and leave theIncrement Type set to None so that each record will be appended to your dataset.226

ChartsFigure 12-6Dataset configuration13. In the Details tab, enter an expression to associate with every value in the data source. For the Pie 3D chart type, threeexpressions can be entered: key, value, and label (Figure 12-6).• Key expression must be a unique value to identify a slice of the pie chart. If a key value is repeated, the label andvalue values previously associated with that key are overwritten. A key can never be null.• Value expression specifies the numeric value associated with the key.• Label expression allows you to specify a label for each slice of the pie chart. This expression is optional, and thedefault value is the key value.14. Preview the report.You should get a result similar to the one in Figure 12-7.227

<strong>iReport</strong> <strong>Ultimate</strong> <strong>Guide</strong>Figure 12-5The Chart Details windowIn this window you can select the data to use in order to create the chart.11. In the Type of Dataset combo box, select Pie dataset.This combo box allows you to specify the dataset types to generate the graph. Usually one dataset type is available, exceptwhen generating an XY Bar chart.12. In the Dataset tab, you can define the dataset within the context of the report. Specifically, Reset Type and Reset Groupallow you to periodically reset the dataset. This is useful, for example, when summarizing data relative to a specialgrouping. Increment Type and Increment Group specify the events that determine when new values must be added to thedataset.By default, each record of the dataset used to fill the chart corresponds to a value printed in the chart. Thisbehavior can be changed, forcing the engine to collect the data for the chart at a specific time (for instance, every time theend of a group is reached).The Increment When expression area allows you to add a flag to determine whether to add a record to the record setdesigned to feed the chart. This expression must return a Boolean value. <strong>iReport</strong> considers a blank string to mean “add allthe records.”For the purposes of this example, set the Reset Type to Report since you don’t want the data to be reset, and leave theIncrement Type set to None so that each record will be appended to your dataset.226

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

Saved successfully!

Ooh no, something went wrong!