Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Dynamic BIRT report not populating xml data (Using Oda datasource which is not populating dynamic attributes of template.)
Dynamic BIRT report not populating xml data [message #1067810] Wed, 10 July 2013 16:34 Go to next message
Gaurav Vishwanath is currently offline Gaurav VishwanathFriend
Messages: 1
Registered: July 2013
Junior Member
Hi,

We are using BIRT 3.7 api to generate dynamic PDF. We are setting up XML data source
using below logic. In below snippet we provides XML string as data source.
Strangely, since last week dynamic data is not getting populated from xml. It is not throwing any exception as such even in the FINEST log level.
As we have not updated any jars so not able to figure out the changes which made this functionality to break. PDF are getting generated without dynamic values.

Is there something else I can try out to set xml data source in java to birt template.




String paramStr = readFileAsString(servletContext.getRealPath("/WEB-INF/classes")
+ "/resources/test.xml");

FileInputStream fis = new FileInputStream(servletContext.getRealPath("/WEB-INF/classes")
+ "/resources/BirtXmlDataTest.rptdesign");
IReportRunnable design = birtReportEngine.openReportDesign(fis);
DesignElementHandle designElementHandle = design.getDesignHandle();
ModuleHandle moduleHandle = designElementHandle.getModuleHandle();
ElementFactory designElementFactory = designElementHandle.getElementFactory();
OdaDataSourceHandle dataSourceHandle = designElementFactory.newOdaDataSource("Data Source",
"org.eclipse.birt.report.data.oda.xml");

moduleHandle.getDataSources().add(dataSourceHandle);

IRunAndRenderTask task = birtReportEngine
.createRunAndRenderTask(design);
PDFRenderOption options = new PDFRenderOption();
options.setSupportedImageFormats("JPG;PNG;BMP;SVG");
options.setOutputFormat(PDFRenderOption.OUTPUT_FORMAT_PDF);
options.setEmitterID(PDFRenderOption.OUTPUT_EMITTERID_PDF);
// options.setOutputStream(response.getOutputStream());
File file = new File("d:\\test" + File.separator + "file2.pdf");
FileOutputStream fos = new FileOutputStream(file);
// options.setOutputStream(response.getOutputStream());
options.setOutputStream(fos);

HashMap<String, Object> contextMap = new HashMap<String, Object>();
contextMap.put("org.eclipse.birt.report.data.oda.xml.inputStream",
new ByteArrayInputStream(paramStr.getBytes()));
contextMap.put(
"org.eclipse.birt.report.data.oda.xml.closeInputStream",
Boolean.TRUE);
task.setAppContext(contextMap);
task.setRenderOption(options);
task.run();
task.close();
Re: Dynamic BIRT report not populating xml data [message #1068052 is a reply to message #1067810] Thu, 11 July 2013 20:18 Go to previous message
Kristopher Clark is currently offline Kristopher ClarkFriend
Messages: 130
Registered: January 2013
Senior Member
Could you run this with eclipsec.exe and see if it's throwing any errors in the console?
Previous Topic:BIRT software download problem
Next Topic:Chart: howto show "Percentile Value Data" as Tooltip (on mouseover)
Goto Forum:
  


Current Time: Tue Aug 20 14:43:30 GMT 2019

Powered by FUDForum. Page generated in 0.01837 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top