|
Re: What Render Options does the Report Designer use? [message #826156 is a reply to message #825865] |
Wed, 21 March 2012 18:31 |
|
The internal viewer does the following:
PDFRenderOption renderOption = new PDFRenderOption( );
renderOption.setBaseURL( baseURL );
if ( servletPath == null || servletPath.length( ) == 0 )
{
servletPath = IBirtConstants.SERVLET_PATH_RUN;
}
renderOption.setOption( IBirtConstants.SERVLET_PATH, servletPath );
renderOption.setSupportedImageFormats( isPDF ? "PNG;GIF;JPG;BMP;SVG" :
"PNG;GIF;JPG;BMP" ); //$NON-NLS-1$ //$NON-NLS-2$
// page overflow setting
switch ( pageOverflow )
{
case IBirtConstants.PAGE_OVERFLOW_AUTO :
renderOption.setOption( PDFRenderOption.PAGE_OVERFLOW,
Integer.valueOf( PDFRenderOption.OUTPUT_TO_MULTIPLE_PAGES ) );
break;
case IBirtConstants.PAGE_OVERFLOW_ACTUAL :
renderOption.setOption( PDFRenderOption.PAGE_OVERFLOW,
Integer.valueOf( PDFRenderOption.ENLARGE_PAGE_SIZE ) );
break;
case IBirtConstants.PAGE_OVERFLOW_FITTOPAGE :
renderOption.setOption( PDFRenderOption.FIT_TO_PAGE,
Boolean.TRUE );
break;
default :
renderOption.setOption( PDFRenderOption.PAGE_OVERFLOW,
Integer.valueOf( PDFRenderOption.OUTPUT_TO_MULTIPLE_PAGES ) );
}
// pagebreak pagination only setting
// Bug 238716
renderOption.setOption( PDFRenderOption.PAGEBREAK_PAGINATION_ONLY,
Boolean.FALSE );
return renderOption;
Not a bunch of options here. What difference are you noticing?
Jason
On 3/21/2012 6:57 AM, Jan Kohnert wrote:
> Hello,
>
> I'm using the BIRT engine to produce reports. Recently I discovered that
> my PDF reports generated with my BIRT environment differ slightly from
> the PDF reports created within the Report Designer. I think that the
> differences are caused by render options. So far I only created a
> PDFRenderOption without any specific settings:
> option = new PDFRenderOption();
>
> What are the render options used by the report designer? My hope is to
> get equal results by setting equal render options...
>
> Designer and engine are running BIRT 3.7.1
>
> Thank you!
|
|
|
|
Re: What Render Options does the Report Designer use? [message #832334 is a reply to message #831191] |
Fri, 30 March 2012 03:09 |
|
Are you using a run then a render operation or a runandrender? Also in
the viewer are you rendering in html and then exporting to pdf? Can you
post the report design?
Jason
On 3/28/2012 11:35 AM, Jan Kohnert wrote:
> Jason,
>
> the problem is that the top margin of the documents is not the same.
> See the picture below:
> http://xoom.cc/images/7voXP.png
>
> notice the top margin!
>
> The document called Designer.pdf was rendered by the BIRT viewer. The
> Reporter.pdf with my program. I tried the settings you posted above but
> they made no difference.
> What else than the render options could be wrong here?
>
> Thank you!
|
|
|
|
Re: What Render Options does the Report Designer use? [message #832905 is a reply to message #832504] |
Fri, 30 March 2012 18:40 |
|
Jan,
Something else is happening here. I just ran your report in the viewer
and using the following code and they both produced the same thing,
which is your pic on the right.
package REAPI;
import java.util.Locale;
import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.engine.api.EngineConfig;
import org.eclipse.birt.report.engine.api.EngineException;
import org.eclipse.birt.report.engine.api.IReportEngine;
import org.eclipse.birt.report.engine.api.IReportEngineFactory;
import org.eclipse.birt.report.engine.api.IReportRunnable;
import org.eclipse.birt.report.engine.api.PDFRenderOption;
import org.eclipse.birt.report.engine.api.impl.RunAndRenderTask;
import org.eclipse.birt.report.engine.api.script.IReportContext;
public class RunAndRenderTaskTest {
public void runReport() throws EngineException
{
RunAndRenderTask task=null;
IReportEngine engine=null;
EngineConfig config = null;
try{
config = new EngineConfig( );
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );
IReportRunnable design = null;
//Open the report design
design = engine.openReportDesign("Reports/pdfissue.rptdesign");
task = (RunAndRenderTask) engine.createRunAndRenderTask(design);
task.setLocale(new Locale("en", "US"));
IReportContext irc = task.getReportContext();
PDFRenderOption options = new PDFRenderOption();
options.setOutputFileName("output/resample/pdfissue.pdf");
options.setSupportedImageFormats("PNG;GIF;JPG;BMP;SWF;SVG");
options.setOutputFormat("pdf");
task.setRenderOption(options);
task.run();
task.close();
engine.destroy();
}catch( Exception ex){
ex.printStackTrace();
}
Platform.shutdown( );
System.out.println("Finished");
}
/**
* @param args
*/
public static void main(String[] args) {
try
{
RunAndRenderTaskTest ex = new RunAndRenderTaskTest( );
ex.runReport();
System.exit(0);
}
catch ( Exception e )
{
e.printStackTrace();
}
}
}
Jason
On 3/30/2012 4:12 AM, Jan Kohnert wrote:
> Jason,
>
> I'm using a run then a render operation. I've also tried run and render just to check it, but the result was the same. In the viewer I render directly to PDF.
>
> I've edited ther report design to not use any data set or barcodes anymore. The result is the same. I've added the report design and new screenshots.
>
> In Sample2.png you can see the output of the new report design. The left picture is the output when running BIRT from my application. The right picture comes from the BIRT Designer.
>
> Thank you!
>
|
|
|
Powered by
FUDForum. Page generated in 0.03272 seconds