<p>Hi,</p><p> </p><p>I need your help please. I find following topic from Jason <a data-ipb='nomediaparse' href='
http://www.eclipse.org/forums/index.php/t/238710/'>http://www.eclipse.org/forums/index.php/t/238710/</a></p><p>This is almost the perfect solution for me. He uses a script in beforeFactory that save the Report as PDF to a path on the server.</p><pre class="_prettyXprint">if( params["createPDF"] == true ){importPackage(Packages.org.eclipse.birt.report.engine.api);var re = reportContext.getReportRunnable().getReportEngine();var des = re.openReportDesign("C:/Consens/Auswertungen_Reports/BIRT_REPORTS/trunk/BIRT_REPORTS/INTERN/Testumgebung/rf/createpdfversion.rptdesign"); var ntask = re.createRunAndRenderTask(des);ntask.setParameterValue("createPDF", false);var options = new PDFRenderOption();var outputfile = "C:/birt/ReportEngine/samples/testtesta.pdf";options.setOutputFileName(outputfile);options.setOutputFormat("pdf");ntask.setRenderOption(options);ntask.run();ntask.close(); }</pre><p>But I would like to save the pdf via "Button". So I have tried to made a button with Text-Item (HTML) like this:</p><pre class="_prettyXprint _lang-html"><input type="button" name="button" value="create_pdf" onclick="if( params["createPDF"] == true ){importPackage(Packages.org.eclipse.birt.report.engine.api);var re = reportContext.getReportRunnable().getReportEngine();var des = re.openReportDesign("C:/Consens/Auswertungen_Reports/BIRT_REPORTS/trunk/BIRT_REPORTS/INTERN/Testumgebung/rf/createpdfversion.rptdesign"); var ntask = re.createRunAndRenderTask(des);ntask.setParameterValue("createPDF", false);var options = new PDFRenderOption();var outputfile = "C:/birt/ReportEngine/samples/testtesta1.pdf";options.setOutputFileName(outputfile);options.setOutputFormat("pdf");ntask.setRenderOption(options);ntask.run();ntask.close(); }"> </pre><p>Could you help me to fix my problem. Because if I click on the Button, nothing happens. Please see attached file. When you set to the correct path, a pdf File will created, if your run the report. And the same thing should happen, if I click on my button.</p><p> </p><p>Thanks a Lot</p><p>kind regards</p><p>rf</p><p> </p><p>PS: at the time the upload have failed!</p><p> </p><p> </p>