Sometimes when using using an XML Data Source from a URL, you need to pass in a parameter which is used in the URL. Take for example an RSS Feed that gives you top news stories for a company based on their ticker symbol. The attached example uses a Report Parameter to gather the ticker symbol and updates the data source URL in the data source's beforeOpen event using the following code:
filelist = this.getExtensionProperty("FILELIST");
filelisturl = filelist.substring(0,filelist.indexOf("=")+1);
this.setExtensionProperty("FILELIST", filelisturl + params["TickerSymbol"]);
<br />
View Live Report<br />
<br />
The report design is also attached to this posting if you would like to download it.<br />
<br />
This report was designed in BIRT 2.2.2.<br />
<br />
UPDATE:<br />
<br />
Since the original posting of this example, Property Bindings support for XML data sources has been added. This example can be modified to run without the need for the beforeOpen script on the data source. In the Data Source Editor select Property Binding on the left, and then add the following to the XML Data Source File textbox:<br />
<br />
"
http://finance.yahoo.com/rss/headline?s=" + params["TickerSymbol"].value<br />
<br />
Make sure you remove the script from beforeOpen on the data source.<br />
<br />
Update tested against Actuate BIRT 11 SP4 (should work against any version supporting property binding on XML data sources).