The Jasperreports Ultimate Guide Third Edition Copyright © 2011 Jaspersoft Corporation
Total Page:16
File Type:pdf, Size:1020Kb
THE JASPERREPORTS ULTIMATE GUIDE PAGE I THE JASPERREPORTS ULTIMATE GUIDE The JasperReports Ultimate Guide Third Edition Copyright © 2011 Jaspersoft Corporation. All rights reserved. Printed in the U.S.A. Jaspersoft, the Jaspersoft logo, Jaspersoft iReport Designer, JasperReports Library, JasperReports Server, Jaspersoft OLAP, and Jaspersoft ETL are trademarks and/or registered trademarks of Jaspersoft Corporation in the United States and in jurisdictions throughout the world. All other company and product names are or may be trade names or trademarks of their respective owners. This is version 0811-UGJ37-6 of the JasperReports Ultimate Guide. PAGE II THE JASPERREPORTS ULTIMATE GUIDE TABLE OF CONTENTS GETTING STARTED.............................................................................................1 INSTALLING JASPERREPORTS....................................................................................1 REQUIREMENTS.....................................................................................................1 X11/HEADLESS JAVA.............................................................................................3 BUILDING THE SOURCE FILES AND RUNNING THE SAMPLES.............................................3 ANT BUILD TOOL...............................................................................................................................3 BUILDING THE PROJECT FROM SOURCE FILES..........................................................................................4 RUNNING THE SAMPLES.......................................................................................................................4 HSQLDB DEMO DATABASE...............................................................................................................4 WORKING WITH REPORT TEMPLATES......................................................................6 CREATING REPORT TEMPLATES................................................................................6 REPORT DESIGN PREVIEW.......................................................................................7 LOADING AND STORING REPORT TEMPLATE FILES.........................................................8 COMPILING REPORT TEMPLATES.............................................................................10 EXPRESSIONS SCRIPTING LANGUAGE........................................................................10 REPORT COMPILERS............................................................................................11 A BRIEF HISTORY OF REPORT COMPILATION..........................................................................................12 CONFIGURATION PROPERTIES TO CUSTOMIZE REPORT COMPILATION............................................................13 JDT COMPILER–SPECIFIC CONFIGURATION PROPERTIES..........................................................................15 ANT TASKS........................................................................................................15 ANT TASKS FOR COMPILING REPORTS.....................................................................15 ATTRIBUTES OF THE REPORT TEMPLATE COMPILATION TASK......................................................................16 ANT TASK FOR DECOMPILING REPORTS................................................................................................17 ANT TASK FOR UPDATING REPORTS....................................................................................................17 FILLING REPORT TEMPLATES..............................................................................19 REPORTING DATA................................................................................................20 GENERATED REPORTS..........................................................................................21 FILLING ORDER (VERTICAL/HORIZONTAL FILLING).......................................................21 PAGE III THE JASPERREPORTS ULTIMATE GUIDE ASYNCHRONOUS REPORT FILLING...........................................................................22 HANDLING GENERATED REPORTS........................................................................24 LOADING AND SAVING GENERATED REPORTS.............................................................24 VIEWING REPORTS...............................................................................................25 PRINTING REPORTS..............................................................................................27 EXPORTING REPORTS...........................................................................................28 LARGE FILE SUPPORT.......................................................................................30 FILE VIRTUALIZER................................................................................................31 SWAP FILE VIRTUALIZER.......................................................................................31 IN-MEMORY GZIP VIRTUALIZER.............................................................................32 API OVERVIEW...............................................................................................33 NET.SF.JASPERREPORTS.ENGINE.DESIGN.JASPERDESIGN............................................................................33 NET.SF.JASPERREPORTS.ENGINE.JASPERREPORT.....................................................................................34 NET.SF.JASPERREPORTS.ENGINE.JASPERCOMPILEMANAGER........................................................................34 NET.SF.JASPERREPORTS.ENGINE.JASPERPRINT........................................................................................34 NET.SF.JASPERREPORTS.ENGINE.JRDATASOURCE...................................................................................34 NET.SF.JASPERREPORTS.ENGINE.JRRESULTSETDATASOURCE....................................................................35 NET.SF.JASPERREPORTS.ENGINE.DATA.JRBEANARRAYDATASOURCE AND NET.SF.JASPERREPORTS.ENGINE.DATA.JRBEANCOLLECTIONDATASOURCE.....................................................35 NET.SF.JASPERREPORTS.ENGINE.DATA.JRXMLDATASOURCE......................................................................35 NET.SF.JASPERREPORTS.ENGINE.JREMPTYDATASOURCE..........................................................................35 NET.SF.JASPERREPORTS.ENGINE.JASPERFILLMANAGER..............................................................................36 NET.SF.JASPERREPORTS.ENGINE.JRABSTRACTSCRIPLET............................................................................36 NET.SF.JASPERREPORTS.ENGINE.JRDEFAULTSCRIPTLET............................................................................36 NET.SF.JASPERREPORTS.ENGINE.JASPERPRINTMANAGER...........................................................................37 NET.SF.JASPERREPORTS.ENGINE.JASPEREXPORTMANAGER ........................................................................37 NET.SF.JASPERREPORTS.ENGINE.JASPERRUNMANAGER ............................................................................37 NET.SF.JASPERREPORTS.VIEW.JRVIEWER..............................................................................................37 NET.SF.JASPERREPORTS.VIEW.JASPERVIEWER.........................................................................................38 NET.SF.JASPERREPORTS.VIEW.JASPERDESIGNVIEWER...............................................................................38 NET.SF.JASPERREPORTS.ENGINE.UTIL.JRLOADER.....................................................................................38 NET.SF.JASPERREPORTS.ENGINE.UTIL.JRSAVER.......................................................................................38 NET.SF.JASPERREPORTS.ENGINE.XML.JRXMLLOADER................................................................................38 NET.SF.JASPERREPORTS.ENGINE.XML.JRPRINTXMLLOADER........................................................................39 REPORT TEMPLATE STRUCTURE..........................................................................40 JRXML...........................................................................................................40 XSD REFERENCE...............................................................................................40 JRXML ENCODING.............................................................................................41 REPORT TEMPLATE PROPERTIES.............................................................................42 PAGE IV THE JASPERREPORTS ULTIMATE GUIDE REPORT NAME................................................................................................................................43 LANGUAGE.....................................................................................................................................43 COLUMN COUNT..............................................................................................................................43 PRINT ORDER.................................................................................................................................43 PAGE SIZE.....................................................................................................................................44 PAGE ORIENTATION..........................................................................................................................44 PAGE MARGINS...............................................................................................................................45 COLUMN SIZE AND SPACING...............................................................................................................45