Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
genReport -m render creates multiple PDF files
steven.peeters
<p>Hi,</p>
<p> </p>
<p>I'm currently experimenting using separate run and render tasks using the genReport batch.</p>
<p>I'm doing this so I can the pageNumber and totalPages variables working.</p>
<p> </p>
<p>I run the batch like this:</p>
<p><em>genreport -m run hello_world.rptdesign</em></p>
<p> </p>
<p>This creates the hello_world.rptdocument file.</p>
<p> </p>
<p>Next I render this file:</p>
<p><em>genreport -m render -f PDF -o test.pdf hello_world.rptdocument</em></p>
<p> </p>
<p>This creates a new single page PDF for each page in the .rptdocument file.</p>
<p> </p>
<p>Is there any parameter of script that allows me to create a single PDF file that includes all pages?</p>
<p> </p>
<p>I've included a simple hello_world.rptdesign as example.</p>
<p> </p>
<p>Thank you for helping.</p>
Find more posts tagged with
Comments
JFreeman
<p>This is happening because the org.eclipse.birt.report.engine.api.ReportRunner class called by the batch file is coded to output to multiple files in the renderReport() method.</p>
<pre class="_prettyXprint _lang-js">
for ( long i = 1; i <= pageCount; i++ )
{
String fileName = pathName + '_' + ( i ) + extName;
options.setOutputFileName( fileName );
task.setPageNumber( i );
task.render( );
}
</pre>
<p>You have a couple of options:</p>
<p> </p>
<p>You can modify the source code to change this behavior to instead render to a single file.</p>
<p> </p>
<p>Alternatively, you can create your own class based on the ReportRunner class with that portion of the code modified and then point to your custom class instead of the ReportRunner class.</p>