Community
Participate
Working Groups
Created attachment 238121 [details] example report design When I generate attached report with separate run and render phases, it is generated with one page and that one page is rendered as two pages in PDF. 1. Open attached report in Web Viewer (there is one page, "page 1 of 1") 2. Export to PDF (there are two pages, both "page 1 of 1") When generating with RunAndRender it is rendered correctly: there are two pages "page 1 of 2" and "page 2 of 2". This bug causes rendering issues in a number of our reports, sometimes in the middle of a long one. Workaround is e.g. changing top padding to top margin in the first (green X) element. Another workaround is to change first element content type from HTML to Plain. But it cannot be HTML and have top padding at the same time without possibility of rendering issues.
Created attachment 238122 [details] example output
Created attachment 238123 [details] example report design
Bug occurs only with Fixed Layout report. When report layout is set to Auto Layout, report has one (1/1) page in the preview ("view in the web browser") and two (1/2, 2/2) in the PDF exported from the web browser.
I think it was introduced while fixing Bug 386238 in 4.2.2 (4.2.1 is not affected). In the LayoutEngine (org.eclipse.birt.report.engine.nLayout), method startForeign( IForeignContent foreign ) there is a special case for Fixed Layout and RunTask: if ( context.isFixedLayout( ) && context.getEngineTaskType( ) == IEngineTask.TASK_RUN && IForeignContent.HTML_TYPE.equals( foreign.getRawType( ) ) ) { HTML2Content.html2Content( foreign ); processHTML( foreign ); } It changes the way of breaking page in the ContainerArea.checkPageBreak()(org.eclipse.birt.report.engine.nLayout.area.impl). Condition in while loop: while ( aHeight + parent.getAbsoluteBP( ) - 3000 > context.getMaxBP( ) ) always evaluates to false, because maxBP is set to Integer.MAX_VALUE in ForeignHTMLRegionLayout line 43 (org.eclipse.birt.report.engine.nLayout.area.impl). This is one of the stacks I have noted to myself while debugging this (it is in the "else" branch of the mentioned if): Thread [qtp902166098-40 - /viewer/frameset?__report=%2Fhome%2Fjankiel%2Fruntime-EclipseApplication%2Ftest-report-project%2Fpage_bug.rptdesign&__format=html&__svg=false&__locale=en_US&__timezone=Poland&__masterpage=true&__rtl=false&__cubememsize=10&__resourceFolder=%2Fhome%2Fjankiel%2Fruntime-EclipseApplication%2Ftest-report-project&&1386296701&__sessionId=20131216_153515_111&__dpi=96] (Suspended) BlockContainerArea(ContainerArea).getOffsetY() line: 773 BlockContainerArea(ContainerArea).getAbsoluteBP() line: 145 BlockContainerArea(ContainerArea).getAbsoluteBP() line: 145 LineArea(ContainerArea).checkPageBreak() line: 748 LineArea.close(boolean, boolean) line: 476 LineArea.close() line: 506 LayoutEngine.closeContainer() line: 376 LayoutEngine._endContainer(IContent) line: 486 LayoutEngine.endContainer(IContainerContent) line: 361 ContentEmitterUtil$EndContentVisitor.visitContainer(IContainerContent, Object) line: 323 ContainerContent.accept(IContentVisitor, Object) line: 42 ContentEmitterUtil$EndContentVisitor.visit(IContent, Object) line: 300 ContentEmitterUtil.endContent(IContent, IContentEmitter) line: 136 LayoutEngine.visitContent(IContent, IContentEmitter) line: 727 LayoutEngine.startForeign(IForeignContent) line: 767 ContentEmitterUtil.startContent(IContent, IContentEmitter) line: 77 HTMLPageBuffer.startContent(IContent, IContentEmitter, boolean) line: 116 TableBreakBuffer.startContent(IContent, IContentEmitter, boolean) line: 287 HTMLLeafItemLM.start(boolean) line: 67 HTMLLeafItemLM(HTMLAbstractLM).layout() line: 139 HTMLPageLM(HTMLBlockStackingLM).layoutNodes() line: 70 HTMLPageLM.layout() line: 92 HTMLReportLayoutEngine.layout(IReportExecutor, IReportContent, IContentEmitter, boolean) line: 100 ReportDocumentBuilder.build() line: 249 RunTask.doRun() line: 269 I haven't enough knowledge of BIRT report rendering algorithm to debug this further; hope this clues will help fixing bug. I'm changing importance to Major as it cases severe problem in rendering PDF reports.
Created attachment 238501 [details] Test report covering both bugs This report renders incorrectly in both 4.2.1 and 4.2.2+. 4.2.1: PAGE 1: 1/4Lorem ipsum... PAGE 2: 1/4Quisque cursus... PAGE 3: 2/4Lorem ipsum... PAGE 4: 2/4Quisque cursus... PAGE 5: 3/4Lorem2 ipsum... PAGE 6: 3/4Quisque cursus et... PAGE 7: 4/4Lorem2 ipsum... PAGE 8: 4/4Quisque cursus... 4.2.2+: PAGE 1: 1/2 Lorem ipsum... PAGE 2: 1/2 Quisque cursus... PAGE 1: 2/2 Lorem2 ipsum... PAGE 2: 2/2 Quisque cursus... Expected: PAGE 1: 1/3 Lorem ipsum... PAGE 2: 2/3 Quisque cursus... PAGE 3: 3/3 blandit eu...