Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Export report to pdf at runtime.(How do you export a report at runtime to pdf using javascript.)
Export report to pdf at runtime. [message #1780944] Tue, 30 January 2018 09:38
Renier Nell is currently offline Renier NellFriend
Messages: 1
Registered: January 2018
Junior Member
How do you export a birt report using javascript at runtime?

The code that I have tried is in the After Render event:



importPackage(Packages.org.eclipse.birt.report.engine.api);

rptdoc = reportContext.getReportRunnable().getReportName();


// Open the rptDocument
  reportDocument = getReportEngine().openReportDocument(rptdoc);

  // Create the render task, configured for the wanted export format
 IRenderTask renderTask = getReportEngine().createRenderTask(reportDocument);

  IRenderOption options = new RenderOption();
  options.setOutputFormat("pdf");
  options.setOutputFileName("C:/test/myfile.pdf");
  renderTask.setRenderOption(options);

 // Launch the render task and close it 
    renderTask.render();
    renderTask.close();

    // Close the rptDocument
    reportDocument.close();




It runs and there are no errors but no pdf gets generated...

My requirement is to run the birt report using an URL and the report should generate itself in a folder as a pdf.

The report should only execute once. I don't want to execute the URL and then in the report it does another runAndRender in after factory, the report should export itself. Hope this makes sense.

I am using Birt 4.5.
Previous Topic:Birt 4.5.0 JARs problem
Next Topic:Cascade Parameters in DataSets
Goto Forum:
  


Current Time: Sat Sep 21 04:36:16 GMT 2024

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

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

Back to the top