iReport Ultimate Guide - Nimsoft Library
iReport Ultimate Guide - Nimsoft Library iReport Ultimate Guide - Nimsoft Library
iReport Ultimate GuideWhen we are finished, we save this template as an XML file sub-type that we call JRXML. Itcontains all the basic information about the report layout, including complex formulas to perform calculations, an optionalquery to retrieve data out of a data source, and other functionality we will discuss in detail in later chapters.A JRXML cannot be used as-is. For performance reasons, and for the benefit of the program that will run the report, iReportcompiles the JRXML and saves it as an executable binary, a JASPER file. A JASPER file is the template that URuses to generate a report melding the template and the data retrieved from the data source. The result is a “meta print”—aninterim output report—that can then be exported in one or more formats, giving life to the final document.The life cycle can be divided into two distinct action sets:• Tasks executed during the development phase (design and planning of the report, and compilation of a UR file source,the JRXML).• Tasks that must be executed in run time (loading of the UR file, filling of the report, and export of the print in a finalformat).The main role of iReport in the cycle is to design a report and create an associated JASPER file, though it is able to previewthe result and export it in all the supported formats. iReport also provides support for a wide range of data sources and allowsthe user to test their own data sources, thereby becoming a complete environment for report development and testing.3.2 JRXML Sources and UR FilesAs already explained, UR defines a report with an XML file. In previous versions, XML syntax was defined witha DTD file (jasperreport.dtd). Starting with Version 3.0.1, JasperReports changed the definition method to allowfor support of user defined report elements. The set of tags was extended and the new XML documents must be validatedusing an XML-Schema document (jasperreport.xsd).Table 3-1A JRXML file is composed of a set of sections, some of them concerning the report’s physical characteristics, such as thedimension of the page, the positioning of the fields, and the height of the bands; and some of them concerning the logicalcharacteristics, such as the declaration of the parameters and variables, and the definition of a query for data selection.The syntax has grown more and more complicated with maturity. This is why many times a tool likeiReport is indispensable.The following figure shows the source code of the report described in the previous chapter (Figure 2-19):. Code Example 3-1 A simple JRMXL file example32
Basic Notions of iReportCode Example 3-1A simple JRMXL file example, continued33
- 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 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 and 44: Basic Notions of iReport(new java.l
- Page 45 and 46: Report StructureCHAPTER 4REPORT STR
- 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
Basic Notions of <strong>iReport</strong>Code Example 3-1A simple JRMXL file example, continued33