BIRT:在 MS Word 中创建报告时出现问题

问题描述 投票:0回答:1

我正在使用带有 BIRT 8 版本和 Eclipse 4.23 的 RCP 客户端产品来生成 Microsoft Word 格式的报告。对于小数据,创建报告没有任何问题。但是,对于大型数据集,会创建单词文件但不完整,并且出现以下异常:

java.lang.NullPointerException
    at org.eclipse.birt.report.engine.emitter.wpml.writer.AbstractWordXmlWriter.cropOverflowString(AbstractWordXmlWriter.java:1204)
    at org.eclipse.birt.report.engine.emitter.wpml.writer.AbstractWordXmlWriter.writeTextInRun(AbstractWordXmlWriter.java:1166)
    at org.eclipse.birt.report.engine.emitter.wpml.writer.AbstractWordXmlWriter.writeTextInParagraph(AbstractWordXmlWriter.java:1077)
    at org.eclipse.birt.report.engine.emitter.wpml.writer.AbstractWordXmlWriter.writeText(AbstractWordXmlWriter.java:1094)
    at org.eclipse.birt.report.engine.emitter.wpml.writer.DocWriter.writeContent(DocWriter.java:272)
    at org.eclipse.birt.report.engine.emitter.wpml.AbstractEmitterImpl.writeText(AbstractEmitterImpl.java:1035)
    at org.eclipse.birt.report.engine.emitter.wpml.DocEmitterImpl.writeContent(DocEmitterImpl.java:258)
    at org.eclipse.birt.report.engine.emitter.wpml.AbstractEmitterImpl.startText(AbstractEmitterImpl.java:411)
    at org.eclipse.birt.report.engine.emitter.wpml.DocEmitter.startText(DocEmitter.java:397)
    at org.eclipse.birt.report.engine.presentation.ContentEmitterVisitor.visitText(ContentEmitterVisitor.java:117)
    at org.eclipse.birt.report.engine.content.impl.TextContent.accept(TextContent.java:71)
    at org.eclipse.birt.report.engine.presentation.ContentEmitterVisitor.visit(ContentEmitterVisitor.java:51)
    at org.eclipse.birt.report.engine.presentation.ContentEmitterVisitor.visitChildren(ContentEmitterVisitor.java:171)
    at org.eclipse.birt.report.engine.presentation.ContentEmitterVisitor.visitCell(ContentEmitterVisitor.java:109)
    at org.eclipse.birt.report.engine.content.impl.CellContent.accept(CellContent.java:215)
    at org.eclipse.birt.report.engine.presentation.ContentEmitterVisitor.visit(ContentEmitterVisitor.java:51)
    at org.eclipse.birt.report.engine.presentation.ContentEmitterVisitor.visitChildren(ContentEmitterVisitor.java:171)
    at org.eclipse.birt.report.engine.presentation.ContentEmitterVisitor.visitRow(ContentEmitterVisitor.java:100)
    at org.eclipse.birt.report.engine.content.impl.RowContent.accept(RowContent.java:69)
    at org.eclipse.birt.report.engine.presentation.ContentEmitterVisitor.visit(ContentEmitterVisitor.java:51)
    at org.eclipse.birt.report.engine.presentation.ContentEmitterVisitor.visitChildren(ContentEmitterVisitor.java:171)
    at org.eclipse.birt.report.engine.presentation.ContentEmitterVisitor.visitTable(ContentEmitterVisitor.java:82)
    at org.eclipse.birt.report.engine.content.impl.TableContent.accept(TableContent.java:104)
    at org.eclipse.birt.report.engine.presentation.ContentEmitterVisitor.visit(ContentEmitterVisitor.java:51)
    at org.eclipse.birt.report.engine.presentation.ContentEmitterVisitor.visitChildren(ContentEmitterVisitor.java:171)
    at org.eclipse.birt.report.engine.presentation.ContentEmitterVisitor.visitContainer(ContentEmitterVisitor.java:73)
    at org.eclipse.birt.report.engine.content.impl.ContainerContent.accept(ContainerContent.java:42)
    at org.eclipse.birt.report.engine.presentation.ContentEmitterVisitor.visit(ContentEmitterVisitor.java:51)
    at org.eclipse.birt.report.engine.presentation.ContentEmitterVisitor.visitChildren(ContentEmitterVisitor.java:171)
    at org.eclipse.birt.report.engine.emitter.wpml.DocEmitterImpl.startForeign(DocEmitterImpl.java:188)
    at org.eclipse.birt.report.engine.emitter.wpml.DocEmitter.startForeign(DocEmitter.java:282)
    at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:77)
    at org.eclipse.birt.report.engine.layout.html.HTMLTableLayoutEmitter.startContent(HTMLTableLayoutEmitter.java:148)
    at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startForeign(ContentEmitterAdapter.java:168)
    at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:77)
    at org.eclipse.birt.report.engine.layout.html.buffer.DummyPageBuffer.startContent(DummyPageBuffer.java:126)
    at org.eclipse.birt.report.engine.layout.html.HTMLLeafItemLM.start(HTMLLeafItemLM.java:67)
    at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:139)
    at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:71)
    at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
    at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)
    at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.resumeLayout(HTMLInlineStackingLM.java:111)
    at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.layoutNodes(HTMLInlineStackingLM.java:160)
    at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
    at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)
    at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:71)
    at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
    at org.eclipse.birt.report.engine.layout.html.HTMLTableBandLM.layoutChildren(HTMLTableBandLM.java:67)
    at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)
    at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:71)
    at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
    at org.eclipse.birt.report.engine.layout.html.HTMLRepeatHeaderLM.layoutChildren(HTMLRepeatHeaderLM.java:46)
    at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)
    at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:71)
    at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)
    at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)
    at org.eclipse.birt.report.engine.api.impl.RenderTask$PageRangeRender.render(RenderTask.java:702)
    at org.eclipse.birt.report.engine.api.impl.RenderTask.render(RenderTask.java:321)

我尝试将 eclipse.ini vm 参数从 -Xmx1024m 更改为 -Xmx4096m。然而,并没有成功。

如果有任何解决该问题的指示,我将不胜感激。预先感谢!

ms-word eclipse-rcp birt birt-emitter
1个回答
0
投票

可能这不是内存问题,而是一个错误。

如果您可以使用 BIRT 4.15 重现该问题,请创建一个独立的报告来演示该问题,并在 BIRT 的 GitHub 站点上创建一个问题。

否则,您可能只能靠自己,只能尝试自己调试问题(提示:通过在发生 NPE 的方法及其调用位置添加断点)。

在这种情况下,您可以创建并编译您自己的 DocEmitter 插件版本,并通过替换包含发射器的 JAR 在您的程序中使用它。

© www.soinside.com 2019 - 2024. All rights reserved.