Hi, <br />
<br />
first, if this is posted in the wrong forum, could you please point me in the right direction. I'd be very grateful.<br />
<br />
Also please bare with my knowledge of both Java and the BIRT API as it is very new to me.<br />
<br />
I understand there is a way to output xml to an xml file, and have your odadatasourcehandle point to this file. We have successfully implemented this. However is there a way to bypass writing out the contents to the file and just feed them directly to the odadatasourcehandle? <br />
<br />
I haven't found much that I was able to use from a google search and I have read this article <a class='bbc_url' href='
http://www.eclipse.org/forums/index.php?t=msg&&th=162952&goto=515646'>link</a> which seemed promissing but I still can't get it to work. So far I have this for my code. Could you please help me out by letting me know what part i'm missing in the code in order to do this?<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if( null != reqTemplateKey ){
RequisitionTemplate reqTemplate = (RequisitionTemplate) DataAccess.selectByKey(RequisitionTemplate.class, reqTemplateKey);
layout = reqTemplate.getPrintLayout();
}else{
layout = (PrintLayout) DataAccess.selectByNamedQuery(Requisition.SELECT_PRINTLAYOUT_BY_REQKEY, new Object[] { reqKey });
}
IReportEngine birtReportEngine = BirtEngine.getBirtEngine(sc);
IReportRunnable design = birtReportEngine.openReportDesign(new ByteArrayInputStream(layout.getPrintLayoutXML().getBytes()));
// set the data source to the data XML servlet
ReportDesignHandle report = (ReportDesignHandle) design.getDesignHandle();
//New way to get xml strem to birt without need for temp xml file
String xmlString = "<node>";
xmlString = xmlString + "<childNode>";
xmlString = xmlString + "<name>test</name>";
xmlString = xmlString + "</childNode>";
xmlString = xmlString + "</node>";
ByteArrayInputStream bais = new ByteArrayInputStream( xmlString.getBytes());
OdaDataSourceHandle dataSource = (OdaDataSourceHandle) report.getDataSources().get(0);
dataSource.setProperty(BIRT_FILELIST, dataUrl.toString());
// create task to run and render report
IRunAndRenderTask task = birtReportEngine.createRunAndRenderTask(design);
task.getAppContext().put("org.eclipse.datatools.enablement.oda.xml.inputStream ", bais);
task.setRenderOption(options);
// run report
task.run();
task.close();</pre>
<br />
Thanks for all the help, <br />
<br />
Alex