Search code examples
eclipsereportbirt

Insert URL into BIRT Report that contains dynamic parameters


I am fairly new to BIRT and I am working on adding some new functionality to one of our existing reports.

We have an application that makes a call to BIRT to generate the report in question. When this report is generated I would like to include a URL at the bottom of the report.

The only issue is that the URL would contain two parameters that are different for each report that gets generated. I created a data source and a data set that I can pull the parameters from, but I am not sure how to create a URL with the parameters that relate to the particular report that is being generated.

I have read that you can create a label and insert a hyperlink, but this doesn't seem to be of much help in my situation.

The URL that gets inserted into the report would need to look as follows:

localhost:8080/Application?key=firstParameter&securityString=secondParameter

Please let me know if I did not explain my situation thoroughly or if you need more clarification.

Best Regards,

-Dave


Solution

  • There are multiple ways to do this.

    For example insert a new "Data" element to the report, set the datatype to "String" and enter as expression the text you want to display, i.e. "My URL" (with quotes because it is an expression).

    Then click on "Binding" tab of this data element and select your dataset. Answer no to the question "Do you want to clear existing binding". In the popup, select all columns required to build the URL.

    Finally use hyperlink property of the data element. May be you missed it can be an expression:

    enter image description here

    This pops up an expression builder, in your case this would result in something like:

    "localhost:8080/Application?key="+row["firstParameter"]+"&securityString="+row["secondParameter"]