iReport Ultimate Guide - Nimsoft Library
iReport Ultimate Guide - Nimsoft Library iReport Ultimate Guide - Nimsoft Library
iReport Ultimate GuideCode Example 3-2JasperTest.java, continued}}exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,outFileName);exporter.setParameter(JRExporterParameter.JASPER_PRINT,print);exporter.exportReport();System.out.println("Created file: " + outFileName);}catch (JRException e){e.printStackTrace();System.exit(1);}catch (Exception e){e.printStackTrace();System.exit(1);}44
Report StructureCHAPTER 4REPORT STRUCTUREIn this chapter we will analyze the report structure, the underlying template that determines the style and organization of areport. We will see the parts that compose it and how they behave in relation to input data as iReport creates an output report.This chapter has the following sections:• Bands• Working with Bands• Summary4.1 BandsA report is defined by means of a type page. This is divided into different horizontal portions named “bands.” When the reportis joined with data to run the print, these sections are printed many times according to their function (and according to the rulesthat the report author has set up). For instance, the page header is repeated at the beginning of every page, while the Detailband is repeated for every elaborated record.Figure 4-1 on page 46 shows a type page divided into the nine main pre-defined bands to which new groups are added. Infact, iReport manages a heading band (Group header) and a recapitulation band (Group footer) for every group. Detail, GroupHeader and Group Footer bands can then be split further into several bands, so we can have Detail 1, Detail 2, and so on.A band is always as wide as the usable page width (that is, excluding the right and left margins). However, its height, even if itis established during the design phase, can vary during the print creation according to the contained elements; it can lengthentowards the bottom of page in an arbitrary way. This typically occurs when bands contain subreports or textfields that have toadapt to the content. Generally, the height specified by the user should be considered the minimal height of the band. Not allbands can stretch dynamically according to the content, in particular the Column Footer, Page Footer and Last Page Footerbands.In general, the sum of all band heights (except for the background) always has to be less than or equal to the page height minusthe top and bottom margins. This rule actually is much more complicated, in fact, there are several different cases and optionsthat must be considered; for example, the Title band may be printed on a different page, the Page Footer and the Last PageFooter may have different sizes and are never considered together, and so on. For your convenience, the maximum allowedband size is dynamically calculated at design time by iReport, which prevents the user from setting invalid band heights(which would lead to a layout verification error at compile time)45
- Page 1 and 2: UNIFIED REPORTER iREPORTULTIMATE GU
- Page 3 and 4: Table of ContentsTABLE OF CONTENTSC
- Page 5: Table of Contents6.1.2 Accessing th
- Page 8 and 9: iReport Ultimate GuideChapter 16 Cr
- Page 10 and 11: iReport Ultimate Guide• TrueType
- Page 12 and 13: iReport Ultimate Guide12
- Page 14 and 15: iReport Ultimate Guide• iReport-x
- Page 16 and 17: iReport Ultimate GuideFigure 2-2Bui
- Page 18 and 19: iReport Ultimate GuideFigure 2-5Win
- Page 20 and 21: iReport Ultimate GuideFigure 2-7Opt
- Page 22 and 23: iReport Ultimate GuideFigure 2-9Dat
- Page 24 and 25: iReport Ultimate GuideFigure 2-11Or
- Page 26 and 27: iReport Ultimate GuideFigure 2-14Re
- Page 28 and 29: iReport Ultimate GuideFigure 2-17Re
- Page 30 and 31: iReport Ultimate Guide9. The last s
- Page 32 and 33: iReport Ultimate GuideWhen we are f
- Page 34 and 35: iReport Ultimate GuideCode Example
- Page 36: iReport Ultimate GuideCode Example
- Page 39 and 40: Basic Notions of iReportjava.util.D
- Page 41 and 42: Basic Notions of iReportof a date,
- Page 43: Basic Notions of iReport(new java.l
- Page 47 and 48: Report StructureGroup HeaderDetailG
- Page 49 and 50: Report StructureThe page margin dim
- Page 51 and 52: Report StructureFigure 4-6Result of
- Page 53 and 54: Report StructureMultiple columns ar
- Page 55 and 56: Report StructureFigure 4-11Properti
- Page 57 and 58: Report StructureAs you can see in F
- Page 59 and 60: Report Structure4.1.3.12 ImportsThe
- Page 61 and 62: Report Structureexample, in a repor
- Page 63 and 64: Report ElementsCHAPTER 5REPORT ELEM
- Page 65 and 66: Report ElementsFigure 5-3Guidelines
- Page 67 and 68: Report ElementsFigure 5-6Element no
- Page 69 and 70: Report ElementsTable 5-1Formatting
- Page 71 and 72: Report ElementsFigure 5-10Table 5-2
- Page 73 and 74: Report ElementsFigure 5-11Custom el
- Page 75 and 76: Report Elements5.1.5.2 RectangleThe
- Page 77 and 78: Report ElementsTable 5-4TypeImage E
- Page 79 and 80: Report ElementsTable 5-5OptionImage
- Page 81 and 82: Report ElementsCode Example 5-1Dyna
- Page 83 and 84: Report ElementsCode Example 5-2Prin
- Page 85 and 86: Report ElementsPDF font namePDF enc
- Page 87 and 88: Report ElementsFor your convenience
- Page 89 and 90: Report ElementsHere there are some
- Page 91 and 92: Report ElementsThe following briefl
- Page 93 and 94: 5.5 Adding Custom Components and Ge
<strong>iReport</strong> <strong>Ultimate</strong> <strong>Guide</strong>Code Example 3-2JasperTest.java, continued}}exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,outFileName);exporter.setParameter(JRExporterParameter.JASPER_PRINT,print);exporter.exportReport();System.out.println("Created file: " + outFileName);}catch (JRException e){e.printStackTrace();System.exit(1);}catch (Exception e){e.printStackTrace();System.exit(1);}44