Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
PDF generating is taking so much of time
dlpraju
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
Find more posts tagged with
Comments
mwilliams
Hi Laxmipathi,
What is the complexity of the report design? Several dataSets? Several tables? How are you limiting the records? Through SQL or with a filter within BIRT? How long do other output formats take? What is your BIRT version? Let me know.