iReport Ultimate Guide - Nimsoft Library
iReport Ultimate Guide - Nimsoft Library iReport Ultimate Guide - Nimsoft Library
iReport Ultimate GuideFigure 15-6Dataset Run definition for a chartFigure 15-6 shows a dataset run for a chart. The dataset run definition is similar to what you use to set up a subreport element.A subreport itself can be seen as a subdataset, and you need to set values for its parameters and specify a connection to use inorder to get the data. You can set the value of the subdataset parameters using expressions containing main report objects (likefields, variables, and parameters), define a parameters map to set values for the subdataset parameters at run time, and definethe connection or data source that will be used by the subdataset.15.3 Working Through an Example SubdatasetThe following step-by-step example shows how to use a subdataset to fill a chart.:1. Create a basic report using a simple SQL query:(select count(*) as tot_orders from orders)The resulting main report will have just a single record containing the total number of orders (see Figure 15-7).302
SubdatasetsFigure 15-7Initial layout2. Create a subdataset as explained above in this chapter (15.1, “Creating a Subdataset,” on page 299). Edit the subdatasetquery and set it to:select SHIPCOUNTRY, COUNT(*) country_orders from ORDERS group by SHIPCOUNTRYThe fields will be registered in the subdataset (see Figure 15-8).Figure 15-8The subdataset to fill the chart3. Now create a chart element in the title, for instance, a Pie 3D (like in Figure 15-9). Right-click the chart and select thechart data menu item to open the chart definition dialog.Figure 15-9The subdataset will be used to fill the chart303
- Page 251 and 252: Flash ChartsFigure 13-10 Specifying
- Page 253 and 254: Flash ChartsFigure 13-12 Bar chart
- Page 255 and 256: Flash ChartsFigure 13-16 The Charts
- Page 257 and 258: Flash ChartsFigure 13-19 Advanced o
- Page 259 and 260: Flash ChartsFigure 13-22 Entering t
- Page 261 and 262: Flash ChartsFigure 13-24 Specifying
- Page 263 and 264: Flash ChartsSpark LineSpark ColumnS
- Page 265 and 266: Flash ChartsFigure 13-32 Common opt
- Page 267 and 268: Flash ChartsFigure 13-35 Output of
- Page 269 and 270: Flash ChartsFigure 13-39 Output of
- Page 271 and 272: Flash ChartsFigure 13-43 Example of
- Page 273 and 274: Flash ChartsFigure 13-46 Specifying
- Page 275 and 276: Flash ChartsFigure 13-49 Specifying
- Page 277 and 278: Lists, Tables, and BarcodesCHAPTER
- Page 279 and 280: Lists, Tables, and BarcodesFor your
- Page 281 and 282: Lists, Tables, and Barcodesidentifi
- Page 283 and 284: Lists, Tables, and BarcodesList ele
- Page 285 and 286: 14.2 TablesLists, Tables, and Barco
- Page 287 and 288: Lists, Tables, and BarcodesiReport
- Page 289 and 290: Lists, Tables, and BarcodesFigure 1
- Page 291 and 292: Lists, Tables, and BarcodesSimilarl
- Page 293 and 294: Lists, Tables, and BarcodesFigure 1
- Page 295 and 296: Lists, Tables, and BarcodesFigure 1
- Page 297 and 298: Lists, Tables, and BarcodesWhen usi
- Page 299 and 300: SubdatasetsCHAPTER 15 SUBDATASETSRe
- Page 301: SubdatasetsUR permits you to use a
- Page 305 and 306: SubdatasetsFigure 15-11 Pie dataset
- Page 307 and 308: CrosstabsCHAPTER 16 CROSSTABSA cros
- Page 309 and 310: CrosstabsUsing the Crosstab Wizard,
- Page 311 and 312: CrosstabsFigure 16-6Outline tree vi
- Page 313 and 314: CrosstabsFigure 16-8Adding a Row Gr
- Page 315 and 316: CrosstabsFigure 16-11 Empty row tot
- Page 317 and 318: CrosstabsFigure 16-16 Crosstab Prop
- Page 319 and 320: CrosstabsFigure 16-19 Crosstab Data
- Page 321 and 322: CrosstabsFigure 16-22 The result of
- Page 323 and 324: InternationalizationCHAPTER 17 INTE
- Page 325 and 326: InternationalizationFigure 17-2Crea
- Page 327 and 328: InternationalizationFigure 17-6New
- Page 329 and 330: InternationalizationFigure 17-7Loca
- Page 331 and 332: ScriptletsCHAPTER 18 SCRIPTLETSA sc
- Page 333 and 334: ScriptletsTable 18-1Report eventsEv
- Page 335 and 336: ScriptletsFigure 18-3Adding a Jar t
- Page 337 and 338: ScriptletsFigure 18-5Build output18
- Page 339 and 340: ScriptletsIf you want to add more s
- Page 341 and 342: ScriptletsThis is what you get in t
- Page 343 and 344: Scriptletsterminates the report exe
- Page 345 and 346: Additional ToolsCHAPTER 19 ADDITION
- Page 347 and 348: Additional ToolsFigure 19-3Date and
- Page 349 and 350: Additional ToolsFigure 19-4Percenta
- Page 351 and 352: 19.5 How to Run the SamplesAddition
SubdatasetsFigure 15-7Initial layout2. Create a subdataset as explained above in this chapter (15.1, “Creating a Subdataset,” on page 299). Edit the subdatasetquery and set it to:select SHIPCOUNTRY, COUNT(*) country_orders from ORDERS group by SHIPCOUNTRYThe fields will be registered in the subdataset (see Figure 15-8).Figure 15-8The subdataset to fill the chart3. Now create a chart element in the title, for instance, a Pie 3D (like in Figure 15-9). Right-click the chart and select thechart data menu item to open the chart definition dialog.Figure 15-9The subdataset will be used to fill the chart303