Code:
- * Demonstration of using RRE to create a Jasper Report
- *
- * To compile:
- * Make sure you've already created RRE. See the instructions
- * on that source member for details.
- *
- *
- * CRTBNDRPG PGM(TEST7_RRE) SRCFILE(RRG/QSOURCE) DBGVIEW(*LIST)
- *
- *
-
- H DFTACTGRP(*NO)
- H OPTION(*SRCSTMT: *NODEBUGIO: *NOSHOWCPY)
- H THREAD(*SERIALIZE)
- H BNDDIR('RRE')
-
- /copy qsource,rre_h
-
- D lReportName s like(jString)
- D lReportOut s like(jString)
- D lReParam s like(jMap)
- D lOutFormat s like(jString)
- D success s N
- D lkey s like(jString)
- D lvalue s like(jString)
- D OutputType S 4A
- *-------------------------------------------------
- * Test the report generator
- *
- * We need the following jars in the classpath:
- * ReportGenerator.jar - Simple wrapper over Jasper
- * commons-beanutils.jar
- * commons-collections-2.1.jar
- * commons-dbcp-1.2.1.jar
- * commons-digester-1.7.jar
- * commons-logging-1.0.2.jar
- * commons-logging-api-1.0.2.jar
- * itext-1.3.1.jar
- * jasperreports-2.0.5.jar
- * jt400.jar
- * poi-3.0.2-FINAL-20080204.jar
- *
- * These parameters will be passed:
- *
- * key - Name of Parameter being passed
- *
- * Value - Actual value of parameter being passed
- *
- * ReportName - Report Template Name - FULL PATH and either the compiled jasper
- * file name OR the jrxml file name (if compiling)
- * ReportOut - Report Output Name - FULL path and file name (extension will
- * be added by output routine)
- * reportParameters = A hashmap will key/value pairs for any parameters that are passed
-
- * OutFormat - Extension (basically) PDF, HTML, XLS, RTF, TXT, CSV, ODT
-
- C *ENTRY PLIST
- C PARM OutputType
-
- /free
- rre_begin_object_group(100);
- lSender = new_String('pete@valadd.com');
- lRecipient = new_String('pete@opensource4i.com');
- lReportName =
- new_String('/reports/templates/employee_listing.jasper');
- lReportOut = new_String('/reports/output/employee_listing');
- lReParam = new_jMap();
- lOutFormat = new_String(%trim(OutputType));
-
- success = rre_iPrintCompiledReport(
- lReportName :lReportOut
- :lReParam
- :lOutFormat );
-
- rre_end_object_group();
- *inlr = *on;
- /end-free
|
|