Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Configure PDF report generated by BIRT designer
Configure PDF report generated by BIRT designer [message #1048126] Wed, 24 April 2013 04:42 Go to next message
megha mukim is currently offline megha mukim
Messages: 6
Registered: March 2013
Junior Member
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 19:45 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1595
Registered: July 2009
Senior Member

You could probably do this with iText. Why do you not add the logo, header, and footer, in BIRT, before generating the file?

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Configure PDF report generated by BIRT designer [message #1049618 is a reply to message #1048655] Fri, 26 April 2013 04:24 Go to previous messageGo to next message
megha mukim is currently offline megha mukim
Messages: 6
Registered: March 2013
Junior Member
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] Sat, 27 April 2013 01:24 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1595
Registered: July 2009
Senior Member

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.

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Configure PDF report generated by BIRT designer [message #1058183 is a reply to message #1050305] Mon, 13 May 2013 06:45 Go to previous messageGo to next message
megha mukim is currently offline megha mukim
Messages: 6
Registered: March 2013
Junior Member
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] Tue, 14 May 2013 02:50 Go to previous message
Michael Williams is currently offline Michael Williams
Messages: 1595
Registered: July 2009
Senior Member

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.


Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Previous Topic:report is working in windows but not in linux
Next Topic:Debug perspective with "scriptlib" folder
Goto Forum:
  


Current Time: Wed Sep 17 01:53:06 GMT 2014

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

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