iReport Ultimate Guide - Nimsoft Library
iReport Ultimate Guide - Nimsoft Library iReport Ultimate Guide - Nimsoft Library
iReport Ultimate Guide16.2.2 Understanding MeasuresA measure is an object similar to a variable. It is always, in some way, the result of a calculation performed on a value for eachrow and column group that intersect a cell. Expressions for elements in a crosstab, such as print-when expressions andtextfield expressions, can only contain measures. In this context, you cannot use fields, variables, or parameters directly; youalways have to use a measure.To create a measure, right-click the measures node in the outline view and select Add Measure (see Figure 16-14). iReportadds the new measure to the outline view.Figure 16-14 Adding a measureJust as when you create a new group, you’ll need to define an expression for the measure. The easiest way to display a newmeasure is to use a textfield. Drag a textfield element into a cell and set the proper textfield expression (for example, with ameasure name like $V{Average_freight}) and the proper expression class for the textfield, which must be consistent withthe measure type.There are several options you can use to set a measure. Besides the name, class, and expression, you can set the calculationtype. If the available calculation types are not enough, you can provide a custom Incrementer class by means of a Factorythat returns an instance of that class (the factory must implement the interfacenet.sf.jasperreports.engine.fil.JRIncrementerFactory).Figure 16-15 Measure PropertiesIf you want to display your measure as a percentage of the grand total, you can set the property Percentage of type toGrand Total.Finally, you can specify a custom calculator class to perform the percentage calculation (the class must use the interfacenet.sf.jasperreports.crosstabs.fill.JRPercentageCalculator).16.3 Modifying Crosstab Element PropertiesTo see the crosstab properties in the property sheet, select the crosstab node in the outline view (see Figure 16-16).316
CrosstabsFigure 16-16 Crosstab PropertiesFollowing is a brief rundown of some of the options in this dialog box:Repeat Column HeadersRepeat Row HeadersColumn Break OffsetIf selected, the column headers will be printed on every page when the crosstabspans additional pages.If selected, the row headers will be printed on every page when the crosstab spansadditional pages.This specifies the space between two pieces of a crosstab when the crosstabexceeds the page width (see Figure 16-17).Figure 16-17 Column Break Offset16.4 Crosstab ParametersCrosstab parameters may be used in the expressions of elements displayed in the crosstab. They can be defined and managedthrough the outline view (see Figure 16-18).317
- 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 and 302: SubdatasetsUR permits you to use a
- Page 303 and 304: SubdatasetsFigure 15-7Initial layou
- 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: CrosstabsFigure 16-11 Empty row tot
- 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
- Page 353 and 354: Chart Theme ExampleAPPENDIX ACHART
- Page 355 and 356: Chart Theme ExampleCode Example A-1
- Page 357 and 358: IndexINDEXAAdd selected field(s) 20
- Page 359 and 360: Indexcomponents 241embedded in Java
- Page 361 and 362: Indexscriptlets 53sheets. See prope
CrosstabsFigure 16-16 Crosstab PropertiesFollowing is a brief rundown of some of the options in this dialog box:Repeat Column HeadersRepeat Row HeadersColumn Break OffsetIf selected, the column headers will be printed on every page when the crosstabspans additional pages.If selected, the row headers will be printed on every page when the crosstab spansadditional pages.This specifies the space between two pieces of a crosstab when the crosstabexceeds the page width (see Figure 16-17).Figure 16-17 Column Break Offset16.4 Crosstab ParametersCrosstab parameters may be used in the expressions of elements displayed in the crosstab. They can be defined and managedthrough the outline view (see Figure 16-18).317