Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Birt Report Error while download as pdf
Migrateduser
HI all,
I have created the .rptdesign file using the birt eclipse plugin.it was working fine.
I tried to export the .rptdesing file as pdf or xls through the java class ,i am getting the error. the following java code which i used to export the file
HttpSession httpSession = request.getSession();
String path = (String) httpSession.getAttribute("path");
// get report name and launch the engine
response.setContentType("application/pdf");
response.setHeader("Content-Disposition",
"inline; filename=xxxx.pdf"); // inline,
// attachment
// String reportName = request.getParameter("ReportName");
String reportName = "****.rptdesign";
ServletContext sc = request.getSession().getServletContext();
this.birtReportEngine = BirtEngine.getBirtEngine(sc);
// setup image directory
HTMLRenderOption options = new HTMLRenderOption();
options.setBaseImageURL(request.getContextPath() + "/images");
options.setImageDirectory(sc.getRealPath("/images"));
HashMap<String, HTMLRenderOption> contextMap = new HashMap<String, HTMLRenderOption>();
contextMap.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT,
options);
IReportRunnable design;
try {
// Open report design
design = birtReportEngine.openReportDesign(sc
.getRealPath("/report")
+ "/" + reportName);
// create task to run and render report
IRunAndRenderTask task = birtReportEngine
.createRunAndRenderTask(design);
task.setAppContext(contextMap);
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF);
options.setOutputStream(response.getOutputStream());
task.setRenderOption(options);
task.run();
task.close();
} catch (Exception e) {
throw new ServletException(e);
}
I am getting the following error
"javax.servlet.ServletException: org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report".
details of the error:
java.lang.NoSuchMethodError: org.eclipse.birt.data.engine.api.querydefn.BaseDataSetDesign.setNeedCache(Z)V
and if i use the response.getOutputStream.flush() to flush the data on the response
its says "file is either in not supported format or file might be damaged "
Can some one please help me to get out on this issues asap.
Thanks
kiran
Find more posts tagged with
Comments
There are no comments yet