PDF rendering issue [message #661308] |
Thu, 24 March 2011 03:01  |
Eclipse User |
|
|
|
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 15:13  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03578 seconds