Use scripts to implement dynamic data sources for reports and dynamic data sources for reports

Source: Internet
Author: User

Use scripts to implement dynamic data sources for reports and dynamic data sources for reports

Some reports in the report system often need to connect different data sources according to the conditions to complete report presentation. This kind of switch between different data sources is called a dynamic data source. Generally, report tools often rely on third-party programs (such as JAVA) to implement dynamic data sources. You can use a built-in script to run dry set computing reports. In this article, we will use an example to understand the implementation process.

 

Report description

In student information, the data source connected to the report is controlled through parameters. If the status parameter is 1, data source 1 (dev_1) is connected. Otherwise, data source 2 (dev_2) is connected, and the total score of students is summarized by class.

In a set computing report, you can use the set computing script to determine parameters and connect different data sources. Then, use the result set returned by the script in the report template, just like using a data source. The procedure is as follows:

 

Edit a Report Template

Create two data sources (dev_1 and dev_2) for report development.


Use the report designer to create a report template and set report parameters, datasets, and report expressions.

Set Report Parameters

Status is used to control the connected data source. The default value is 1, and dev_1 is connected.

 

Set Dataset

Use the script dataset to determine the connected data source based on the parameters and calculate the number of retrieved data:

In A1, the data source to be connected is determined based on the Report parameters. A2 completes Data Query and the results are returned through A4.

 

Set a report expression

Edit the report expression, directly use the result set returned by the Set Computing script, and use a simple report expression to complete report creation.


We can see that using the script dataset to complete the dynamic data source connection by simply judging the parameters of the received report, without having to complete it in the Java program, it is simpler and more direct.

For more information about the script dataset, see http://blog.csdn.net/u012388497/article/details/40076481.


Related Article

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.