简体   繁体   中英

BIRT - Passing Report URL parameters to DataSource URL

I have two servers - one for application(Apache http) and another for BIRT reporting (tomcat). I will have BIRT reports designed with XML Schema files, wherein Datasource URL will be given as

http://localhost/myApp/index.php

Now, the actual URL to access report is as below

http://localhost:8080/birtviewer/frameset?__report=DummyOrder.rptdesign

Now, when is pass a parameter in the Report URL, it should be passed to the Datasource URL, as below:

Report URL: http://localhost:8080/birtviewer/frameset?__report=DummyOrder.rptdesign&OrderNo=101
DataSourceURL: http://localhost/myApp/index.php?OrderNo=101

Is there a way to achieve this??

Double click on your XML-Data-Source and select "property binding" on the left. Enter a function in to the "XML data source file:" field like below:

if (params["OrderNo"] != null){
 "jdbc:mysql://localhost/myApp/index.php?OrderNo=" + params["OrderNo"];
}else{
 "jdbc:mysql://localhost/myApp/index.php";
}

There is also a section in the birt wiki on how to change the data source at runtime.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM