Project: Birt
Bug 247641 Bug in PDFRenderOption.PDF_TEXT_WRAPPING disabled
Reported: 2008-09-17 08:47:57 | Status: resolved fixed

I disabled PDFRenderOption.PDF_TEXT_WRAPPING option in org.eclipse.birt.report.service.ReportEngineService.java in org.eclipse.birt.report.viewer application. I've added following code to PDFRenderOption createPDFRenderOption( String servletPath, HttpServletRequest request, int pageOverflow, boolean isDesigner ) function: renderOption.setOption( PDFRenderOption.PDF_TEXT_WRAPPING, Boolean.FALSE ); so now it looks like: private PDFRenderOption createPDFRenderOption( String servletPath, HttpServletRequest request, int pageOverflow, boolean isDesigner ) { .... // pagebreak pagination only setting renderOption.setOption( PDFRenderOption.PAGEBREAK_PAGINATION_ONLY, Boolean.TRUE ); renderOption.setOption( PDFRenderOption.PDF_TEXT_WRAPPING, Boolean.FALSE ); return renderOption; } Then I've recompiled this project and got new version of viewservlets.jar. Now when I try to generate reports in Birt, I get the following stack trace: 008-09-17 14:18:17 org.eclipse.birt.report.engine.api.impl.RenderTask render SEVERE: An error happened while running the report. Cause: java.lang.NullPointerException at org.eclipse.birt.report.engine.layout.pdf.emitter.TextCompositor.getNextTextArea(TextCompositor.java:161) at org.eclipse.birt.report.engine.layout.pdf.emitter.TextCompositor.getNextArea(TextCompositor.java:116) at org.eclipse.birt.report.engine.layout.pdf.emitter.TextAreaLayout.layoutChildren(TextAreaLayout.java:109) at org.eclipse.birt.report.engine.layout.pdf.emitter.TextAreaLayout.layout(TextAreaLayout.java:100) at org.eclipse.birt.report.engine.layout.pdf.emitter.InlineTextLayout.layout(InlineTextLayout.java:34) at org.eclipse.birt.report.engine.layout.pdf.emitter.PDFLayoutEmitter.startContent(PDFLayoutEmitter.java:372) at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startText(ContentEmitterAdapter.java:134) at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startLabel(ContentEmitterAdapter.java:140) at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:63) at org.eclipse.birt.report.engine.layout.pdf.emitter.PDFLayoutEmitter.visitContent(PDFLayoutEmitter.java:551) at org.eclipse.birt.report.engine.layout.pdf.emitter.PDFLayoutEmitter.visitContent(PDFLayoutEmitter.java:559) at org.eclipse.birt.report.engine.layout.pdf.emitter.PDFLayoutEmitter.startForeign(PDFLayoutEmitter.java:577) at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:75) at org.eclipse.birt.report.engine.layout.pdf.emitter.Layout.visitContent(Layout.java:365) at org.eclipse.birt.report.engine.layout.pdf.emitter.Layout.visitContent(Layout.java:373) at org.eclipse.birt.report.engine.layout.pdf.emitter.Layout.visitContent(Layout.java:373) at org.eclipse.birt.report.engine.layout.pdf.emitter.Layout.visitContent(Layout.java:373) at org.eclipse.birt.report.engine.layout.pdf.emitter.Layout.visitContent(Layout.java:373) at org.eclipse.birt.report.engine.layout.pdf.emitter.RegionLayout.layout(RegionLayout.java:78) at org.eclipse.birt.report.engine.layout.pdf.emitter.PageLayout.layoutFooter(PageLayout.java:161) at org.eclipse.birt.report.engine.layout.pdf.emitter.PageLayout.initialize(PageLayout.java:80) at org.eclipse.birt.report.engine.layout.pdf.emitter.PDFLayoutEmitter._startContainer(PDFLayoutEmitter.java:297) at org.eclipse.birt.report.engine.layout.pdf.emitter.PDFLayoutEmitter.startContainer(PDFLayoutEmitter.java:262) at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startPage(ContentEmitterAdapter.java:54) at org.eclipse.birt.report.engine.layout.pdf.emitter.PDFLayoutEmitter.startPage(PDFLayoutEmitter.java:407) at org.eclipse.birt.report.engine.emitter.CompositeContentEmitter.startPage(CompositeContentEmitter.java:284) at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:45) at org.eclipse.birt.report.engine.layout.html.buffer.PageNode.start(PageNode.java:48) at org.eclipse.birt.report.engine.layout.html.buffer.ContainerBufferNode.start(ContainerBufferNode.java:78) at org.eclipse.birt.report.engine.layout.html.buffer.ContainerBufferNode.start(ContainerBufferNode.java:78) at org.eclipse.birt.report.engine.layout.html.buffer.ContainerBufferNode.start(ContainerBufferNode.java:78) at org.eclipse.birt.report.engine.layout.html.buffer.ContainerBufferNode.start(ContainerBufferNode.java:78) at org.eclipse.birt.report.engine.layout.html.buffer.HTMLPageBuffer.startContent(HTMLPageBuffer.java:105) at org.eclipse.birt.report.engine.layout.html.buffer.TableBreakBuffer.startContent(TableBreakBuffer.java:159) at org.eclipse.birt.report.engine.layout.html.HTMLLeafItemLM.start(HTMLLeafItemLM.java:50) at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:132) at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:68) at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:27) at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:133) at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.resumeLayout(HTMLInlineStackingLM.java:104) at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.layoutNodes(HTMLInlineStackingLM.java:153) at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:27) at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:133) at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:68) at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:27) at org.eclipse.birt.report.engine.layout.html.HTMLTableBandLM.layoutChildren(HTMLTableBandLM.java:65) at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:133) at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:68) at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:27) at org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layoutChildren(HTMLTableLM.java:76) at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:133) at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:68) at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:90) at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:101) at org.eclipse.birt.report.engine.api.impl.RenderTask$PageRangeRender.render(RenderTask.java:478) at org.eclipse.birt.report.engine.api.impl.RenderTask.render(RenderTask.java:221) at org.eclipse.birt.report.service.ReportEngineService.renderReport(ReportEngineService.java:1316) at org.eclipse.birt.report.service.BirtViewerReportService.renderReport(BirtViewerReportService.java:285) at org.eclipse.birt.report.service.actionhandler.BirtRenderReportActionHandler.__execute(BirtRenderReportActionHandler.java:66) at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:89) at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.doService(FramesetFragment.java:222) at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.service(FramesetFragment.java:86) at org.eclipse.birt.report.servlet.ViewerServlet.__doGet(ViewerServlet.java:181) at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doGet(BirtSoapMessageDispatcherServlet.java:146) at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:229) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:112) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:595) I didn't have that problems in eariel Birt versions with PDFRenderOption.PDF_TEXT_WRAPPING disabled.

Files changed in fix:
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/layout/pdf/emitter/TextCompositor.java