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
Generating PDF
Migrateduser
Hello,<br />
I'd like to generate a pdf via JavaScript. I'm using BIRT 2.5.2. I've added the following code in the report "beforeRender" event but the atttributeBean value is always null. What am I doing wrong?<br />
Also <br />
Thanks for your help!<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>importPackage(Packages.org.eclipse.birt.report.engine.api);
//attributeBean is a Birt Viewer supplied session variable
var request = reportContext.getHttpServletRequest();
if (request) {
var attributeBean = request.getAttribute('attributeBean');
if (attributeBean && !attributeBean.isDesigner()) {
var reportDoc = attributeBean.getReportDocumentName();
var re = reportContext.getReportRunnable().getReportEngine();
var doc = re.openReportDocument(reportDoc);
var options = new PDFRenderOption();
var outputfile = 'c:/report.pdf';
options.setOutputFileName(outputfile);
options.setOutputFormat('pdf');
ntask = re.createRenderTask(doc);
ntask.setRenderOption(options);
ntask.render();
doc.close();
ntask.close();
}
}</pre>
Find more posts tagged with
Comments
There are no comments yet