Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » PDF rendering issue(While generating PDF file it is taking too much time)
PDF rendering issue [message #661308] Thu, 24 March 2011 07:01 Go to next message
laxmipathi raju is currently offline laxmipathi rajuFriend
Messages: 17
Registered: April 2010
Junior Member
Hi,
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 issue [message #663362 is a reply to message #661308] Mon, 04 April 2011 19:13 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Hi Laxmipathi,

That is a lot of records to process by BIRT, so the time it takes BIRT to create a report vs the time it takes your database to return data will vary by a lot. How are you limiting your 150,000,000 down to 100,000? Are you using a filter or are you limiting it in your query? If you have the option of limiting your query and you're not, this is one spot where you could gain a lot of time.

Regards,

Michael
http://www.birt-exchange.org


Michael

Developer Evangelist, Silanis
Previous Topic:Multiple stacked columns in a bar chart
Next Topic:Group Header in Detail Line
Goto Forum:
  


Current Time: Thu Apr 25 05:19:31 GMT 2024

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

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

Back to the top