Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » genreport -m render split pdf file
genreport -m render split pdf file [message #494483] Fri, 30 October 2009 16:07 Go to next message
skyline240 is currently offline skyline240
Messages: 6
Registered: October 2009
Junior Member
I have a report about 4 pages long.
Using genreport -f pdf -o output.pdf test.rptdesign
it generates a single pdf file.

However, if I split run and render.

genreport -m run test.rptdesign
genreport -m render -f pdf -o output.pdf test.rptdocument

It splits the output to 3 files.
output_1.pdf
output_2.pdf
output_3.pdf

Any idea?
Re: genreport -m render split pdf file [message #494806 is a reply to message #494483] Mon, 02 November 2009 12:18 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Yes the code is setup render a pdf per page:

if ( pageNumber <= 0 )
{
int extPos = targetFile.lastIndexOf( '.' );
assert extPos != -1;
String pathName = targetFile.substring( 0, extPos );
String extName = targetFile.substring( extPos );
long pageCount = document.getPageCount( );
if ( pageCount == 1 )
{
options.setOutputFileName( targetFile );
task.setPageNumber( 1 ); //$NON-NLS-1$
task.render( );
}
else
{
for ( long i = 1; i <= pageCount; i++ )
{
String fileName = pathName + '_' + ( i ) + extName;
options.setOutputFileName( fileName );
task.setPageNumber( i );
task.render( );
}
}
}

You could change the ReportRunner class to use task.setPageRange instead
of task.setPageNumber. Or you could write your own RE API class to run
it how you want.

Jason



tony_ser@hotmail.com wrote:
> I have a report about 4 pages long.
> Using genreport -f pdf -o output.pdf test.rptdesign
> it generates a single pdf file.
>
> However, if I split run and render.
>
> genreport -m run test.rptdesign
> genreport -m render -f pdf -o output.pdf test.rptdocument
>
> It splits the output to 3 files.
> output_1.pdf
> output_2.pdf
> output_3.pdf
>
> Any idea?
Re: genreport -m render split pdf file [message #890596 is a reply to message #494483] Fri, 22 June 2012 12:14 Go to previous messageGo to next message
Mark Westling is currently offline Mark Westling
Messages: 1
Registered: June 2012
Junior Member
I've just opened up an enhancement request to make this file-per-page behavior an option. I see that new users can't post links, so add https in front of this:

bugs.eclipse.org/bugs/show_bug.cgi?id=383274
Re: genreport -m render split pdf file [message #890681 is a reply to message #890596] Fri, 22 June 2012 16:44 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Thanks for posting

Jason

On 6/22/2012 12:14 PM, Mark Westling wrote:
> I've just opened up an enhancement request to make this file-per-page
> behavior an option. I see that new users can't post links, so add https
> in front of this:
>
> bugs.eclipse.org/bugs/show_bug.cgi?id=383274
Previous Topic:How to use BIRT 3.7.1 on NetBeans?
Next Topic:JSP-Files behind Toolbar
Goto Forum:
  


Current Time: Sat Jul 26 13:35:06 EDT 2014

Powered by FUDForum. Page generated in 0.02762 seconds