Home
Analytics
XML file as input when generating report with java program
nithinurs
Hi,
I'm trying to generate a birt report with java program using report engine api, i wanted to know how can i pass a string variable which contains the xml data as the input to generate the report.
Currently i'm reading a xml file from fixed path and then generating report. I'm using BIRT 4.2.0
Thank you.
Find more posts tagged with
Comments
nithinurs
Hi,<br />
I'm trying to generate a birt report with java program using report engine api, i wanted to know how can i pass a String object which contains the xml data as the input to generate the report.<br />
<br />
When i tried to pass the string object like - <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>contextMap.put("org.eclipse.datatools.enablement.oda.xml.inputStream",xmlString);</pre>
<br />
and run the report, i'm getting a blank page.<br />
So i wanted to confirm whether we can pass the String object in this way.<br />
<br />
or is the only possible by reading from FileInputstream ?<br />
<br />
I'm using BIRT 4.2.0<br />
<br />
<br />
Thank you.
mwilliams
The XML source requires a file location or URL, so I'm not certain you'll be able to pass your XML in as a string to use with the XML dataSet. You might be able to set up a temporary file to use. You could create a scripted dataSet and pass your data in and parse it yourself. You could also try modifying the XML dataSource to take a string as a source.
nithinurs
Thanks for the reply williams.
I converted the String Object into InputStream, and then passed it. This kind of usage is proper i guess rite ?
mwilliams
So, everything is working as you have it? If so, I'd say its proper.