Skip to main content



      Home
Home » Archived » BIRT » XML datasource with dynamic URL
XML datasource with dynamic URL [message #713685] Mon, 08 August 2011 15:36 Go to next message
Eclipse UserFriend
Hello,

I am trying to use an XML datasource in the BIRT reports.

We have REST webservices which expose the data in the form of "http://<serverName>/subject/{Id}.xml?user=<User>&token=<token>".

When i try in Eclipse, i need to give the whole URL but i want to avoid that because the server url, id, user and the token will be dynamic.

Is it possible to use report parameters in the URL of the XML so that they could be set dynamically as the report task parameters?

I know how to set the report task parameters but can i set the parameters in the URL of the XML datasource?

Is there a way?

Thank you

Tuco
Re: XML datasource with dynamic URL [message #713697 is a reply to message #713685] Mon, 08 August 2011 16:22 Go to previous message
Eclipse UserFriend
Have you tried changing the url using a beforeOpen script like:

this.setExtensionProperty("FILELIST", params["myxmllocation"].value);

If you want to change the query you need to set query text in the
beforeOpen of the dataset like

this.queryText = "table1#-TNAME-#table1#:#[/companies/company[@id='" +
params["companyid"].value
+"']/employee]#:#{id;STRING;/@id},{companyid;STRING;../@id}"

Jason



On 8/8/2011 3:36 PM, Tuco wrote:
> Hello,
> I am trying to use an XML datasource in the BIRT reports.
>
> We have REST webservices which expose the data in the form of
> "http://<serverName>/subject/{Id}.xml?user=<User>&token=<token>".
>
> When i try in Eclipse, i need to give the whole URL but i want to avoid
> that because the server url, id, user and the token will be dynamic.
>
> Is it possible to use report parameters in the URL of the XML so that
> they could be set dynamically as the report task parameters?
>
> I know how to set the report task parameters but can i set the
> parameters in the URL of the XML datasource?
>
> Is there a way?
>
> Thank you
>
> Tuco
Re: XML datasource with dynamic URL [message #713699 is a reply to message #713685] Mon, 08 August 2011 16:22 Go to previous message
Eclipse UserFriend
Have you tried changing the url using a beforeOpen script like:

this.setExtensionProperty("FILELIST", params["myxmllocation"].value);

If you want to change the query you need to set query text in the
beforeOpen of the dataset like

this.queryText = "table1#-TNAME-#table1#:#[/companies/company[@id='" +
params["companyid"].value
+"']/employee]#:#{id;STRING;/@id},{companyid;STRING;../@id}"

Jason



On 8/8/2011 3:36 PM, Tuco wrote:
> Hello,
> I am trying to use an XML datasource in the BIRT reports.
>
> We have REST webservices which expose the data in the form of
> "http://<serverName>/subject/{Id}.xml?user=<User>&token=<token>".
>
> When i try in Eclipse, i need to give the whole URL but i want to avoid
> that because the server url, id, user and the token will be dynamic.
>
> Is it possible to use report parameters in the URL of the XML so that
> they could be set dynamically as the report task parameters?
>
> I know how to set the report task parameters but can i set the
> parameters in the URL of the XML datasource?
>
> Is there a way?
>
> Thank you
>
> Tuco
Previous Topic:Rendering protected images in HTML texts
Next Topic:PDF and page number
Goto Forum:
  


Current Time: Tue Jul 22 18:15:19 EDT 2025

Powered by FUDForum. Page generated in 0.03174 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top