04.06.2015 Views

iReport Ultimate Guide - Docs.nimsoft.com

iReport Ultimate Guide - Docs.nimsoft.com

iReport Ultimate Guide - Docs.nimsoft.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>iReport</strong> <strong>Ultimate</strong> <strong>Guide</strong><br />

Code Example 3-1<br />

A simple JRMXL file example, continued<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

During <strong>com</strong>pilation of the JRXML file (using some JasperReports classes), the XML is parsed and loaded in a JasperDesign<br />

object, which is a rich data structure that allows you to represent the exact XML contents in memory. Without going into<br />

details, regardless of which language is used for expressions inside the JRXML, JasperReports creates a special Java class that<br />

represents the whole report. The report is then <strong>com</strong>piled, instanced and serialized in a JASPER file, ready for loading at any<br />

time.<br />

JasperReports’s speedy operation is due to all of a report’s formulas being <strong>com</strong>piled into Java-native bytecode and the report<br />

structure being verified during <strong>com</strong>pilation instead of run time. The JASPER file does not contain extraneous resources, such<br />

as images used in the report, resource bundles to run the report in different languages, or extra scriptlets and external style<br />

definitions. All these resources must be provided by the host application and located at run time.<br />

36

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

Saved successfully!

Ooh no, something went wrong!