Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Birt get resource path(get resource path of the report executing)
Birt get resource path [message #1800596] Thu, 03 January 2019 07:54 Go to next message
alba voli is currently offline alba voliFriend
Messages: 1
Registered: January 2019
Junior Member
i want to get the path of the report before render so i can save as a pdf locally on my server.Can anyone help me on this?
i have used the code below but no success
mmap = reportContext.getHttpServletRequest().getAttribute("attributeBean").getModuleOptions();
rptdoc = reportContext.getHttpServletRequest().getAttribute("attributeBean").getReportDocumentName();

importPackage(Packages.org.eclipse.birt.report.engine.api);
importPackage(Packages.java.io)
var re = reportContext.getReportRunnable().getReportEngine();
var mdocument = re.openReportDocument(null,rptdoc, mmap);
var options = new PDFRenderOption();
baos = new ByteArrayOutputStream();
options.setOutputFormat("pdf");
options.setOutputStream(baos);

var ntask = re.createRenderTask(mdocument);
ntask.setRenderOption(options);
ntask.render();
ntask.close();
mdocument.close();

//str = "blabla";

success1 = (new File("../webapps/WebViewerExample/alba")).mkdir(); //create directory
//var path = "myreport_" + str;

fout = new FileOutputStream(success1 + params["id"] + ".pdf"); //This name needs to be dynamic
fout.write(baos.toByteArray());
fout.flush();
fout.close();
Re: Birt get resource path [message #1800626 is a reply to message #1800596] Thu, 03 January 2019 21:02 Go to previous message
Mihail Mihaylov is currently offline Mihail MihaylovFriend
Messages: 1
Registered: January 2019
Junior Member
Does this example help: https://wiki.eclipse.org/Retrieve_Session_information_in_Script_(BIRT)
OR this:
https://www.eclipse.org/forums/index.php/t/355193/
Previous Topic:Convert TO EPOCH time stamp
Next Topic:BIRT and MaximoDataSet
Goto Forum:
  


Current Time: Tue Nov 19 00:36:02 GMT 2019

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

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

Back to the top