A simple multi-source report for multi-data source report resolution

Source: Internet
Author: User

A multi-data source report is a report where you can define multiple datasets, take out the database tables you need, and even get database tables from different databases. In this paper, several examples are given to illustrate how multiple data set data are interrelated to achieve multi-source reporting.

1. Description

Multiple data sources, that is, in the same report, the data displayed is from a number of different tables or different libraries.

such as a simple multi-data source report, the blue part of the left is from the sales table, the right yellow part from the Sales Totals table, that is, the data from two different database tables:

2. Example

2.1 Open a single data source report

Open Report %FR_HOME%\WEBREPORT\WEB-INF\REPORTLETS\DOC\PRIMARY\CROSSREPORT\CROSS.CPT .

2.2 New Data source

sql statement is select * from [ Total sales] ds1 The dataset has a salesperson field.

2.3 binding Data Columns

For example, the DS2 The total sales data column is dragged into the cell, and the parent is set to the salesperson's cell, which expands the total sales to the salesperson:

2.4 Set Filter

At this point, the designer previews the effect as follows:

You can see that all the data in the Sales Total field is displayed repeatedly under each salesperson that is expanded.

Although the parent of the sales totals is the Salesperson data column, because they come from different datasets, the sales totals do not filter the parent salesperson as a condition, that is, there is no affiliate relationship.

We need the sales amount to correspond with salesperson one by one, we need to set up the filter condition, associate the data of the two datasets with the salesperson.

Select the cell in which the total sales amount is located, set Filter , add the filter condition: sales clerk equals ' C4 ' , remove the data that matches the salesperson in the C4 cell, such as:

2.5 Save and preview

Save the template, preview the report, and see the effect as above.

3. Multi-data source reporting benefits

Multi-data source reporting the traditional approach is to consolidate multiple sources into a single source through the consolidation of SQL. In the example above, we will integrate the sales list with the total sales table. SELECT * fromSales volume , total sale where sales . Sales Clerk = Total Sales . Sales Clerk   . If your database tables are complex and you use more than 2 tables , you can imagine that the final SQL query statement will be very complex.

FineReport Natural support for multiple data sources of the report, a report can add any number of datasets, each dataset using the simplest SQL statement to query out the required table data, in the report only need to use filtering to be able to relate the data from different tables together. Make it easier to make multi-data source reports.

A simple multi-source report for multi-data source report resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.