PentahoReportDesigner beginners tutorial (2) PentahoReportDesigner5.1 is the latest version. I. Installation and introduction: first install jdk, configure java environment variables, download pentahoreport, decompress it, and run it directly. 2. Example 3: integrated display in the Swing Program
PentahoReport Designer quick start tutorial (2) Pentaho Report Designer5.1 is the latest version. I. Installation and introduction: first install jdk, configure java environment variables, download pentaho report, decompress the report, and run it directly. 2. Example 3: integrated display in the Swing Program
PentahoReport Designer getting started tutorial (2)
Pentaho Report Designer5.1 is the latest version.
I. Installation and introduction
This section describes how to install jdk, configure java environment variables, download pentaho report, decompress the report, and run it directly.
Ii. Example 1
3. Integration in Swing programs
The sample program consists of three parts:
1. Create a simple Swing program and display two buttons, preview the report and close the program;
Click the Preview button to bring up the report page.
2. Compile an ant script to automatically compile and run the program (optional)
3. embedded report content and corresponding jar package description
? Initialize the report engine:
ClassicEngineBoot. getInstance (). start ();
? Report resource file loading code:
ResourceManager manager =NewResourceManager ();
Manager. registerDefaults ();
Resource res = manager. createDirectly (NewURL (
"File: data/ch2_1.prpt"), MasterReport.Class);
MasterReport report = (MasterReport) res. getResource ();
? Show report Event code:
Final PreviewDialog preview = newPreviewDialog (report );
Preview. addWindowListener (newWindowAdapter (){
Publicvoid windowClosing (final javaswevent event ){
Preview. setVisible (false );
}
});
Preview. pack ();
Preview. setVisible (true );
? Jar Package Description
Jar File |
Description |
Libbase. jar Libdocbundle. jar Libfonts. jar Libformat. jar Libformula. jar Libloader. jar Librepository. jar Libserializer. jar Libxml. jar Libswing. jar Pentaho-reporting-engine-classic-core.jar Pentaho-reporting-engine-classic-extensions.jar |
The jar package corresponding to the report engine. libswing. jar is added to version 5.1. Each jar file name ends with a version. required; |
Commons-logging-api.jar |
Log usage, required; |
Poi-3.9.jar Poi-ooxml-3.9.jar Poi-ooxml-schemas-3.9.jar Xmlbeans-2.5.0.jar Dom4j-1.6.1.jar |
Generate excel-related files; optional; |
Itext-2.1.7.jar |
Generate pdf; optional; |
Itext-rtf-2.1.7.jar |
Rtf file; optional; |
4. Integration in j2ee
To be continued...