I. Overview
1. Version
Rreport server version |
---|
10.0 |
2. Expected effect
In the previous section, we introduced a Simple multi-source report , and in practical applications, it is also common for the rows and columns and summary calculation data in the crosstab to come from different databases.
As shown in the figure below, in this report, the total number of projects, the number of financial arrangements required, the unit self-raised, and other funds all come from different data sets.
3. Implementation ideas
The data in this report comes from 5 different datasets. The data association of different data sets can be displayed in a table through the data column association method in the report.
This avoids the situation of combining five data sets into a single source through complex SQL statements in the traditional report processing method, which greatly reduces the difficulty of report production and the requirements for the SQL level of report designers.
II. Examples
1 Report making
1 Create a new datasetThe data table of the database is a separate table of project ID and project name. There are also four lists of project number, financial fund, unit self financing and other funds.
Each table establishes a relationship with the project name table through the ID field. Here are five built-in datasets:
Note: click the Add button in the data set panel and select the built-in dataset to create a new built-in dataset and add data directly. Please check the built-in dataset for details.
Project name (ID, ProjectName) - project
Total number of items (ID, Num) - totalNum
Financial allocation (ID, Amount) - Financial
Unit self financing (ID, Amount) - Company
5) Other funds (ID, Amount) - Other
The report style is as follows:
2. Data setting and filtering setting
Drag the data column to the cell in turn, and the settings are as follows:
Cell | Dataset | Column | Setting |
---|---|---|---|
B4 | project | project name | data set grouping and vertical expansion from top to bottom, other default |
C4 | totalNum | Num | data set summary and summation, no expansion, filter condition is "data column": ID equals project.ID , other defaults |
E4 | Financial | Amount | data set summary and summation, no expansion, filter condition is "data column": ID equals project.ID , other defaults |
F4 | Company | Amount | data set summary and summation, no expansion, filter condition is "data column": ID equals project.ID , other defaults |
G4 | Other | Amount | data set summary and summation, no expansion, filter condition is "data column": ID equals project.ID , other defaults |
Take C4 as an example:
Other cells are similar and will not be explained in detail.
3. Numbering and formula
Write the formula in the grid where you need to add number and calculate summary, as shown in the following table:
Cell | Formula | Other settings |
---|---|---|
A4 | =&B4 | in the right-click extension attribute, define its left parent as B4 |
D4 | =sum(E4:G4) | none |
C5 | =sum(C4) | none |
D5 | =sum(D4) | none |
E5 | =sum(E4) | none |
F5 | =sum(F4) | none |
G5 | =sum(G4) | none |
Note: the data in this report comes from five different datasets. Through the data column association method in the report, the data association of different data sets is displayed in a table.
In order to avoid the traditional report processing method, through the complex SQL statements, the five data sets are put together into a single source, which greatly reduces the difficulty of report making and the requirement of SQL level for report designers.
4. Effect preview
1) PC terminal
Save the template and select pagination preview. The effect is as shown in I. Overview.
2) Mobile terinal
APP:
HTML5:
III. Template download
For completed templates, see %fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\ReportApplication\BasicApplication\ComplexMulti.cpt
Click download template: