Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » XML datasource with dynamic URL
XML datasource with dynamic URL [message #713685] Mon, 08 August 2011 19:36 Go to next message
Tuco  is currently offline Tuco Friend
Messages: 6
Registered: August 2011
Junior Member
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 20:22 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 20:22 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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: Sun Dec 21 08:39:16 GMT 2014

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

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