Implementing a Dynamic Data source for a report with a script

Source: Internet
Author: User

There are some reports in the report system that are often connected to different data sources according to the conditions to complete the report presentation. The need to switch between different data sources is what we call Dynamic Data sources. General reporting tools to implement dynamic data sources often rely on third-party programs (Java, etc.) implementation, run-dry set of reports can be completed through the built-in script, this article will be an example to understand the implementation process.

Report description

Student information through the parameters of the data source Control report connection, the parameter status is 1 o'clock connection data source One (dev_1), otherwise connected to the data source two (dev_2), according to the class summary student total.

In a set report, you connect different data sources by completing the parameters of the set-up script, and then use the result set returned by the script in the report template, as you would with a data source. The following are the specific steps:

Edit a report template

You first need to create a new two data source (Dev_1 and Dev_2) for report development.


Use the collection Report Designer to create a new report template and set report parameters, datasets, and report expressions.

Set Report Parameters

The status is used to control the data source of the connection, which defaults to 1 and connects Dev_1.

Set up datasets

Use the script dataset to determine the connected data source based on the parameters and complete the calculation of the fetch:

In A1 according to the report parameters to determine the data source to be connected, A2 complete the data query, the results are returned through A4.

To set a report expression

Edit the report expression, use the result set returned by the collection script directly, and complete the report production using a simple report expression.


As you can see, it is easier and straightforward to use a script dataset to make a dynamic Data source connection without having to do it in a Java program by simply judging it by receiving report parameters.

See the script data set in: http://blog.csdn.net/u012388497/article/details/40076481.


Implementing a Dynamic Data source for a report with a script

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.