Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » PDF rendering is taking so much time(Rendering data from rptdocument and creating a PDF file is taking so much time why?)
PDF rendering is taking so much time [message #655459] Mon, 21 February 2011 04:33 Go to next message
laxmipathi raju is currently offline laxmipathi raju
Messages: 17
Registered: April 2010
Junior Member
Hi,
Creating PDF file using birt APIs is taking so much time. May i know the reason for it?

We are first generating a rptdoc file then from that i am rending the data and creating PDF file. This rendering data from rptdoc file and creating PDF file is taking so much time. Nearly 30 min it is taking. The output file size is 196 MB .
The PDF file has 1,25,000 pages

Can anybody provide the reason?

Thanks & Regards,
Laxmipathi Raju

[Updated on: Mon, 21 February 2011 05:08]

Report message to a moderator

Re: PDF rendering is taking so much time [message #655825 is a reply to message #655459] Tue, 22 February 2011 12:25 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Does the pdf contain chart? You may want to look at this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=301665
You can add a beforeRender script and change whether pdf supports svg like:
//Use svg
var xyz =
reportContext.getRenderOption().getOption("supportedImageFormats ");
reportContext.getRenderOption().setOption("supportedImageFormats ", xyz
+";SVG");

If you do not want it to, set the option to:
"PNG;GIF;JPG;BMP"


Jason

On 2/21/2011 4:33 AM, laxmipathi raju wrote:
> Hi,
> Creating PDF file is taking so much of tim. Can i know why it is taking
> time?
>
> We are first generating a rptdoc file then from the rending the data and
> creating PDF file. This rendering and creating is taking time. Nearly 30
> min it is taking. The output file size is 197 MB and it is taking 30
> mins of time.
>
> Please try to give the reason for the delay.
>
> Thanks & Regards,
> Laxmipathi Raju


Jason Weathersby

BIRT Exchange
Re: PDF rendering is taking so much time [message #658624 is a reply to message #655825] Wed, 09 March 2011 05:14 Go to previous messageGo to next message
laxmipathi raju is currently offline laxmipathi raju
Messages: 17
Registered: April 2010
Junior Member
Thanks for Your response Jason.

In the report we don't have any image still it is taking so much time. Can you tell whether there is any problem in that PDF rendering.


Thanks & Regards,
Laxmipathi Raju
Re: PDF rendering is taking so much time [message #658745 is a reply to message #658624] Wed, 09 March 2011 11:19 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Can you give some more detail on how you are running the report and the
size of the dataset?

Jason

On 3/9/2011 5:14 AM, laxmipathi raju wrote:
> Thanks for Your response Jason.
>
> In the report we don't have any image still it is taking so much time.
> Can you tell whether there is any problem in that PDF rendering.
>
>
> Thanks & Regards,
> Laxmipathi Raju


Jason Weathersby

BIRT Exchange
Re: PDF rendering is taking so much time [message #661173 is a reply to message #658745] Wed, 23 March 2011 09:20 Go to previous messageGo to next message
laxmipathi raju is currently offline laxmipathi raju
Messages: 17
Registered: April 2010
Junior Member
Dear Jason,
I am trying to generate a rpt design file in PDF format. In my database i have 150 million records and out of it i am trying to fetch first 1 lakh records and generating a PDF file it is taking me 33 mins to generate. From database i got the data with in 2 mins but to generate PDF file it took around 31 mins. In my report i have 255 columns. The code i have used is as below. Can any body tell me why it is taking this much time to generate a PDF file. Can any body provide me an Optimized way of generating PDF files.

public static void main(String[] args)
{
String newReportDesign = "reports/3lack256report_PVG.rptdesign";
String format = PDFRenderOption.OUTPUT_FORMAT_PDF;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
boolean showInfo = true;

if(args.length > 0){
reportDesign = args[0];
}
if(args.length > 1){
newReportDesign = args[1];
}
ChartApiPDF capi = new ChartApiPDF( );
capi.run( newReportDesign, format );
}
public void run( String reportDesign, String format )
{
// Create a runnable report from the reportDesign.

IReportRunnable report = null;
try
{
report = engine.openReportDesign( reportDesign );
}
catch ( EngineException e )
{
System.err.println( "Report " + reportDesign +
" not found!\n" );
engine.destroy( );
return;
}
// Create a task to run the report
IRunAndRenderTask task = engine.createRunAndRenderTask( report );

//PDF Render Options start
PDFRenderOption options = new PDFRenderOption();

//pdfOptions.setOutputFileName(outputFilePath);
options.setSupportedImageFormats("JPG;PNG;BMP;SVG");
options.setOutputFormat(format);

options.setOption(IPDFRenderOption.PAGE_OVERFLOW,
IPDFRenderOption.ENLARGE_PAGE_SIZE);
//PDF Render Options end


// Give the report the same name as the design,
// except give it the appropriate extension
String output = reportDesign.replaceFirst( ".rptdesign",".pdf" );
//String output = reportDesign.replaceFirst( ".rptdesign",".html" );
//"." + format );
options.setOutputFileName( output );
// Set the render options on the RunAndRenderTask object
task.setRenderOption( options );
// Run the report.
try {
task.run( );
}
catch ( EngineException e1 )
{
System.err.println( "Report " + reportDesign +
" run failed.\n" );
System.err.println( e1.toString( ) );
}

engine.destroy( );
}

}



Thanks & Regards,
Laxmipathi Raju
Re: PDF rendering is taking so much time [message #661468 is a reply to message #661173] Thu, 24 March 2011 14:43 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Can you open a bugzilla entry for this and post the code below to it?
Also if you could post the design to it as well it would be good.

Jason

On 3/23/2011 9:20 AM, laxmipathi raju wrote:
> Dear Jason,
> I am trying to generate a rpt design file in PDF format. In my database
> i have 150 million records and out of it i am trying to fetch first 1
> lakh records and generating a PDF file it is taking me 33 mins to
> generate. From database i got the data with in 2 mins but to generate
> PDF file it took around 31 mins. In my report i have 255 columns. The
> code i have used is as below. Can any body tell me why it is taking this
> much time to generate a PDF file. Can any body provide me an Optimized
> way of generating PDF files.
>
> public static void main(String[] args)
> {
> String newReportDesign = "reports/3lack256report_PVG.rptdesign";
> String format = PDFRenderOption.OUTPUT_FORMAT_PDF;
> BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
> boolean showInfo = true;
>
> if(args.length > 0){
> reportDesign = args[0];
> }
> if(args.length > 1){
> newReportDesign = args[1];
> }
> ChartApiPDF capi = new ChartApiPDF( );
> capi.run( newReportDesign, format );
> }
> public void run( String reportDesign, String format )
> {
> // Create a runnable report from the reportDesign.
>
> IReportRunnable report = null;
> try
> {
> report = engine.openReportDesign( reportDesign );
> }
> catch ( EngineException e )
> {
> System.err.println( "Report " + reportDesign +
> " not found!\n" );
> engine.destroy( );
> return;
> }
> // Create a task to run the report
> IRunAndRenderTask task = engine.createRunAndRenderTask( report );
>
> //PDF Render Options start
> PDFRenderOption options = new PDFRenderOption();
>
> //pdfOptions.setOutputFileName(outputFilePath);
> options.setSupportedImageFormats("JPG;PNG;BMP;SVG");
> options.setOutputFormat(format);
>
> options.setOption(IPDFRenderOption.PAGE_OVERFLOW,
> IPDFRenderOption.ENLARGE_PAGE_SIZE);
> //PDF Render Options end
>
>
> // Give the report the same name as the design,
> // except give it the appropriate extension
> String output = reportDesign.replaceFirst( ".rptdesign",".pdf" );
> //String output = reportDesign.replaceFirst( ".rptdesign",".html" );
> //"." + format );
> options.setOutputFileName( output );
> // Set the render options on the RunAndRenderTask object
> task.setRenderOption( options );
> // Run the report.
> try {
> task.run( );
> }
> catch ( EngineException e1 )
> {
> System.err.println( "Report " + reportDesign +
> " run failed.\n" );
> System.err.println( e1.toString( ) );
> }
>
> engine.destroy( );
> }
>
> }
>
>
>
> Thanks & Regards,
> Laxmipathi Raju
>


Jason Weathersby

BIRT Exchange
Previous Topic:'Parameter Selection Page' window
Next Topic:Insert a fixed table
Goto Forum:
  


Current Time: Fri Apr 18 06:52:47 EDT 2014

Powered by FUDForum. Page generated in 0.01742 seconds