Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 334267

Summary: Page break doesn't work in word emitter
Product: z_Archived Reporter: vdemin <zersaa>
Component: BIRTAssignee: Birt-ReportEngine-inbox <Birt-ReportEngine-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: bluesoldier, jouyang, wyan, zersaa
Version: 2.6.2   
Target Milestone: 3.7.0   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Example report
none
Document generated none

Description vdemin CLA 2011-01-13 10:09:38 EST
Build Identifier: M20100909-0800

BIRT 2.6.1
I have put a several page break in my report (with page-break-after=always). Html page break works correctly. When I export the report to PDF the page break works just fine. When I 
export the report to Word the page break is lost.

Reproducible: Always
Comment 1 Xiaoying Gu CLA 2011-02-10 02:08:34 EST
I can not reproduce this issue in 2.6.1.

It will be a great help if you could attach the report design that can reproduce this issue.
Comment 2 vdemin CLA 2011-02-11 10:57:32 EST
Created attachment 188784 [details]
Example report
Comment 3 vdemin CLA 2011-02-11 11:38:37 EST
My php-code looks like:

$taskOptions = new java("org.eclipse.birt.report.engine.api.RenderOption");
$outputStream = new java("java.io.ByteArrayOutputStream");
$taskOptions->setOutputStream($outputStream);
$taskOptions->setOutputFormat("doc");
$ih = new java("org.eclipse.birt.report.engine.api.HTMLServerImageHandler");
$taskOptions->setImageHandler($ih);            
$task->setRenderOption($taskOptions);
$task->render();
Comment 4 Jun Ouyang CLA 2011-02-25 04:20:58 EST
I can't reproduce this bug, my java code is like follows:

		IReportRunnable design = engine
		        .openReportDesign( "D:/workspace/runtime-New_configuration/Reports4/attachment.rptdesign" );

		IRunAndRenderTask task = engine.createRunAndRenderTask( design );
		HTMLRenderOption options = new HTMLRenderOption( );
		options.setOutputFileName( "d:/test.doc" );
		options.setOutputFormat( "doc" );
		task.setRenderOption( options );
		task.run( );
		task.close( );

Please attache the render options.
Comment 5 Jun Ouyang CLA 2011-02-25 04:22:03 EST
Created attachment 189779 [details]
Document generated
Comment 6 Xiaoying Gu CLA 2011-03-04 02:13:07 EST
Set as worksforme.
Comment 7 vdemin CLA 2011-06-09 18:35:08 EDT
You right. If use RunAndRenderTask, page break is exported OK.
But If use RenderTask (after RunTask), page break ignored.

>Please attache the render options.
Sorry, what do you mean? Is this not $taskOptions (see my php code)?
Comment 8 vdemin CLA 2011-06-14 06:40:43 EDT
Hmm.. I replaced

$taskOptions = new java("org.eclipse.birt.report.engine.api.RenderOption");

to

$taskOptions = new java("org.eclipse.birt.report.engine.api.HTMLRenderOption");
$taskOptions->setHtmlPagination(true);

And now it's OK. It's not like a logical solution, but so be it.
Set as RESOLVED.
Comment 9 Wei Yan CLA 2011-06-14 13:18:26 EDT
If you uses the RenderOption, you need set the HTMLPagination to true manually, as the RenderOption is a generic option which doesn't include any default settings for specific output.

If you uses the HTMLRenderOption, the HTMLPagination is default to true.
Comment 10 vdemin CLA 2011-06-14 14:23:39 EDT
>If you uses the RenderOption, you need set the HTMLPagination to true manually
How?

>If you uses the HTMLRenderOption, the HTMLPagination is default to true.
HTMLPagination is default to true even if you use RenderOption, but only for RunAndRenderTask. For RenderTask, HTMLPagination is default to false.