Skip to main content



      Home
Home » Archived » BIRT » Configure PDF report generated by BIRT designer
Configure PDF report generated by BIRT designer [message #1048126] Wed, 24 April 2013 00:42 Go to next message
Eclipse UserFriend
I generate the PDF file of the report from BIRT. I want to add a logo, header and footer to the PDF file generated. Is it possible to manipulate the PDF generated?
Please tell me if its possible and how can it be done if possible.

It is urgent.
Thanks in advance
Re: Configure PDF report generated by BIRT designer [message #1048655 is a reply to message #1048126] Wed, 24 April 2013 15:45 Go to previous messageGo to next message
Eclipse UserFriend
You could probably do this with iText. Why do you not add the logo, header, and footer, in BIRT, before generating the file?
Re: Configure PDF report generated by BIRT designer [message #1049618 is a reply to message #1048655] Fri, 26 April 2013 00:24 Go to previous messageGo to next message
Eclipse UserFriend
In our web application we have a feature of uploading the required logo,header and footer through the application itself. So I need to add these to the pdf only if there is something uploaded else no image to be added. Moreover I am using the BIRT APIs in java to fetch the required format like pdf or ppt etc. So I am not understanding where exactly do I do any configurations required to get the desired file.
Re: Configure PDF report generated by BIRT designer [message #1050305 is a reply to message #1049618] Fri, 26 April 2013 21:24 Go to previous messageGo to next message
Eclipse UserFriend
BIRT should allow you to specify dynamic images and header/footer text. If you're using the API's you could pass this information in through parameters or through the AppContext and use it within the BIRT report to use the correct image and header/footer text. Maybe I'm misunderstanding.
Re: Configure PDF report generated by BIRT designer [message #1058183 is a reply to message #1050305] Mon, 13 May 2013 02:45 Go to previous messageGo to next message
Eclipse UserFriend
hi thanks for ur reply, but I am pretty new to the API's and use of scripts in BIRT reports. Can you please show me a sample code how to use it in my Java code, if possible.?

There is something like this in the java code of our application, can you just give me a pointer where do I exactly use what code to modify the pdf contents to include an image as header and footer?

final IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
final IReportEngine engine = factory.createReportEngine(config);
final String reportPath = getTemplatePath(vizQuery);
final IReportRunnable design = engine.openReportDesign(reportPath);
final ReportDesignHandle report = (ReportDesignHandle) design.getDesignHandle();
final List dataSets = report.getAllDataSets();
task = engine.createRunAndRenderTask(design);

String exportFormat = vizQuery.getExportFormat();
if (exportFormat == null) {
exportFormat = (String) ((Map) vizQuery.getFilter()).get("EXPORT_REPORT_TYPE");
vizQuery.setExportFormat(exportFormat);
}

IRenderOption options = getOutputRenderOption(vizQuery);

if (isForExport(vizQuery)) {
options.setOutputStream((OutputStream) ((Map) vizQuery.getFilter()).get("outputStream"));
}

task.setRenderOption(options);

//Run and render report
task.run();
Re: Configure PDF report generated by BIRT designer [message #1058410 is a reply to message #1058183] Mon, 13 May 2013 22:50 Go to previous message
Eclipse UserFriend
You can add stuff to the app context like:

config.getAppContext().put("headerLogo","image.jpg");

Then, you can recall this within your report design with something like:

reportContext.getAppContext().get("headerLogo");

This should allow you to pass the values of the images chosen in your app to the report design. Then, you can use the value to determine which image to show and use another for the text.
Previous Topic:report is working in windows but not in linux
Next Topic:Debug perspective with "scriptlib" folder
Goto Forum:
  


Current Time: Thu Apr 24 23:22:55 EDT 2025

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

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

Back to the top