Sowmiya
Sowmiya

Reputation: 313

BIRT - using multiple webservices to get the data

I am trying to generate a report using Eclipse BIRT report designer.

The scenario is this:

There are 2 web service data sources. There are 2 datasets for webservices 'WS1' and 'WS2' respectively.

The output element 'COUNTRYID' of one webservice 'WS1' would go as input for another webservice 'WS2'.

What I did:

But the report does not display the values from the response of the web service 'WS2'

My questions:

Upvotes: 0

Views: 184

Answers (1)

Dominique
Dominique

Reputation: 4342

WS1 is not fired unless it is explicitely bound to a report element. Typically, to achieve this we apply following steps:

  • insert a data element at the beginning of the report body
  • turn the property visibility of this new element to false (or let it visible during testing)
  • bind it to the first dataset WS1

It will force a silent execution of WS1, and therefore this will populate your parameter COUNTRYID before WS2 runs.

However this approach would not work if:

  • WS2 dataset has to be used to populate selection items of a report parameter (which does not seem to be the case here)
  • If COUNTRYID parameter is used at render time. This point is much more annoying, if you need this parameter in chart expressions for example. If so, i would recommend to store WS1 in a report variable instead of (or why not in addition to) a report parameter. See this topic to see how to create a report variable.

You can initialize it at the same place you did for the report parameter with:

vars["COUNTRYID"]=row["COUNTRYID"];

and use it anywhere with

vars["COUNTRYID"];

Report variables are available from the palette of expressions editor :

Upvotes: 0

Related Questions