Home
Analytics
XML as parameter for XML datasource
Timas
I have XML and want to pass it to BIRT report, based on XML DataSource.
XML DataSource wants physical xml-file.
I don't wan't upload XML to xml-file, I want directly to pass it to BIRT report.
What are variants for implementing this task?
Find more posts tagged with
Comments
mwilliams
To use the XML dataSource, you'll probably have to have a file. You could always download the source and change this. Another option could be to use a scripted dataSet. This link might help you with that:
http://stackoverflow.com/questions/649614/xml-parsing-of-a-variable-string-in-javascript
kclark
This is just theory though I think it should work if done right<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
-Create a file called tmp.xml and place it in your resources
-Create a data source that is pointed to tmp.xml
-Create a variable with your XML source called xmlVar
-Script some code that writes vars["xmlVar"] to tmp.xml
-From here you would script your data sets, etc
</pre>
<br />
Like I said the theory should be solid though I don't think it's worth all of the work unless you're wanting to allow a report parameter to allow for XML input and even then you'd still be better off just providing the XML url. Why don't you want to use an XML file? Provided the theory just to see what other users thought.
Timas
I found solution, using BIRT java api <a class='bbc_url' href='
http://www.birt-exchange.org/org/forum/index.php/topic/14367-xml-datasource-as-inputstream/'>http://www.birt-exchange.org/org/forum/index.php/topic/14367-xml-datasource-as-inputstream/</a>
;
mwilliams
Very nice! Could you post the steps you used to do this, to the devShare? You'd be entered to win the devShare contributor of the month contest:
http://www.birt-exchange.org/org/wiki/index.php?title=DevShare_Contributor_of_the_Month_Contest
.