PentahoReportDesigner adopts PentahoReportDesigner5.1, which is also the latest version. I. Installation and introduction: first install jdk, configure java environment variables, download pentahoreport, decompress it, and run it directly. Ii. First example: PentahoReporting
PentahoReport Designer adopts Pentaho Report Designer5.1, which is also the latest version. I. Installation and introduction: first install jdk, configure java environment variables, download pentaho report, decompress the report, and run it directly. Ii. First example: Pentaho Reporting
PentahoReport Designer getting started
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
This example is an example in chapter 2 of Pentaho Reporting 3.5 for Java Developers, which is easy to use; 11 java libraries and their sizes are displayed in the report (the latest version 5.1 is no longer 11), and the number and size of java libraries are summarized. Create a new folder named chapter2 to store the created report file.
The report environment and basic content will not be introduced for the time being, and will be described in detail when used.
1. Create and configure data sources
First, we need to define a dataset for the report. To simplify the example, we use a table dataset. On the Right of the report designer, clickDataTab, right-click and selectTable. Click the plus icon to create a table dataset named libDs. By default, there are two columns. Click the Add column button, add a column, name it Library Size, and set the type to java. lang. integer. Click Add row to add table data. The data content is as follows.
The content is as follows:
Click OK. The data view on the right is as follows:
2. Report Layout
After the dataset is defined, we design the report, which includes the report title, column title, and obvious content. Finally, the report summary content.
2.1 create a report title
Drag from the left-side ToolbarLabelDouble-click the icon in the Report Header section and change its content to Pentaho Report EngineLibrary Repor. Change the font size to 16 PX. You can also modify the font in the format menu. Click the Label control, or you can drag to change the other size.
2.2 create a column title
Under the report title, add three labels as the Column Titles: Library Name, Library Description, and Library Size. Select Guides à Snap under the view menu to enable automatic capturing to make it easier to align the label to the grid. You can also double-click the ruler to add the ruler line, as shown in; drag the horizontal line on the left-side toolbar, add a horizontal line under the column title, and modify the Style of the horizontal line through the Style attribute under the structure tab on the right, mainly to modify the Style and width of the line by stock, the text-color attribute modifies the color of the line.
2.3 fill in the details section
The content of the detailed section is automatically filled based on the number of rows in the dataset. In this example, there are 11 rows of data, so the detailed section will automatically show the content of 11 rows again.
Drag the dataset field to the detailed section to adjust the size and alignment. You can press the shift key and select multiple controls through the mouse stroke range. You can set the alignment mode in a unified way and select the alignment Mode Under the Format menu.
2.4 Design Report Summary
Finally, create a Report Summary section, including the sum of the number of java libraries and the size of java libraries. We add a horizontal line at the top of the report footer segment, and then add two labels with the following content: Library Count and Total Library Size. You can select the control and press the arrow key (top, bottom, left, and right) for fine-tuning.
The number and total size of the created function compute library are as follows. Click the data tab on the right, right-click the function item of the Tree node, select Add Functions, select Count (Running category), modify the function name attribute, and name it Library Count. Add the function again, select Sum (Running), modify the function name attribute to Total Library Size, and modify the summary field to Library Size.
Drag the two functions to the report footer section and adjust the position.
2.5 preview and save the report
Click the preview button on the left of the toolbar on the canvas to preview the report. You can also preview the report by using the green triangle symbol in the File menu or toolbar to ensure that the design content is correctly displayed.
If you are satisfied with your design, save the report to prepare for subsequent integration and save it to chapter2/data/chapter2_1.prpt through the File menu.
The report file is saved in an open‑net format similar to OpenOffice. orgs. It is a zip compressed file consisting of a master xml file and some other resource files. The following sections integrate the report.
3. Integration in Swing programs
4. Integration in j2ee