Overview
Version
Report Server Version | Functional Change |
11.0 | / |
Expected Effect
A multi-source report contains data from multiple datasets. These datasets come from different database tables and have data associations among themselves, namely the same fields.
For example, the table below consists of data from the two datasets: ds1 and ds2. The ds1 data come from the database table Orders and the ds2 data from Client, but the two datasets have the same field: Customer ID, which means an association exists between them.
The effect is shown in the following figure.
Implementation Method
If you do not want to write complicated SQL statements, you can utilize the same field (Customer ID) through certain functions to create the association between datasets and display data relations.
Example
Data Preparation
1. Create a dataset named ds1. The SQL query statement is SELECT * FROM Orders.
2. Create a dataset named ds2. The SQL query statement is SELECT * FROM Client.
The two datasets have the same field: Customer ID.
Designing a Table
Design a table according to the effect shown in the following figure and drag the fields from the two datasets into corresponding cells.
Fields in the ds1 dataset are dragged into cells A2 to D2. Fields in the ds2 dataset are dragged into cells E2 to F2.
Adding a Dataset Association
After dragging fields into cells, you still cannot preview the template because the data in the two datasets are associated, and you need to display that association.
Double-click cell E2 to add a filter condition to the cell. Set the values in the Customer ID field in ds2 to be equal to those in ds1 to associate the two datasets.
Effect Display
1. On PC
Save the template and click Pagination Preview. The effect is the same as that shown in section "Expected Effect."
2. On Mobile Terminals
The preview effects on the DataAnalyst app and the HTML5 terminal are the same, as shown in the following figure.
Template Download
You can download the template: Simple Multi-Source Report.cpt.