Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Using XML data source element as input for db query
miller
<p>Hi All,</p>
<p> </p>
<p>I am trying to create a report that has two data sources. One is a XML Resource that provides relevant information for executing the data set of data resource 2 (query on a db).</p>
<p> </p>
<p>My question here is: How to put the retrieved data element of the XML data source to the relevant query?</p>
<p> </p>
<p>My idea was putting the retrieved data element into a local variable (scripted) and provide this information as a default parameter in the sql query. Currently it does not work.</p>
<p> </p>
<p>Are there any standard approaches or easier ways to accomplish this?</p>
<p> </p>
<p>Thx for the help and regards</p>
<p>Clem</p>
Find more posts tagged with
Comments
micajblock
<p>If there are no items in the report that use the XML data source it will not be executed. Put a table at the top of your report with data from the XML data source (set the visibility to false) and that should work.</p>
miller
<p>Thats all right.. so I am going to set the variable in the onFetch method of my XML data source like reportContext.getAppContext().put("batchID", param["XMLValue"].value); and for the default value of the parameter (in my sql query) I retrieve it with reportContext.getAppContext().get("batchID").</p>
<p>But it is still not working. What am I doing wrong?</p>
micajblock
<p>What version of BIRT are you using?</p>
miller
<p>Hi mblock,</p>
<p> </p>
<p>I found the problem as I was using the getAppContext.. now with reportContext.setPersistentGlobalVariable and reportContext.getPersistentGlobalVariable my report does work!.</p>
<p> </p>
<p>Thx</p>