mysticfall / pivot4j

Pivot4J provides a common API for OLAP servers which can be used to build an analytical service frontend with pivot style GUI.
Other
128 stars 99 forks source link

PDF export no longer works in Pentaho platform. #139

Open mysticfall opened 10 years ago

mysticfall commented 10 years ago

It seems Pentaho platform bundles its own version of FOP, and throws following exception when PDF export is requested :

Caused by: java.lang.ClassCastException: org.apache.fop.render.pdf.PDFRendererMaker cannot be cast to org.apache.fop.render.AbstractRendererMaker
        at org.apache.fop.render.RendererFactory.discoverRenderers(RendererFactory.java:425)
        at org.apache.fop.render.RendererFactory.<init>(RendererFactory.java:61)
        at org.apache.fop.apps.FopFactory.<init>(FopFactory.java:179)
        at org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:190)
        at org.pivot4j.ui.fop.FopExporter.createFopFactory(FopExporter.java:271)
        at org.pivot4j.ui.fop.FopExporter.startRender(FopExporter.java:320)
        at org.pivot4j.ui.fop.FopExporter.startRender(FopExporter.java:40)
        at org.pivot4j.ui.table.TableRenderer.render(TableRenderer.java:439)
        at org.pivot4j.analytics.ui.PivotExportHandler.exportPdf(PivotExportHandler.java:406)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.apache.el.parser.AstValue.invoke(AstValue.java:191) 
mysticfall commented 10 years ago

Upon some tests, found the root cause of the problem. Even though IPluginClassLoader implementation of Pentaho platform supports overriding class loading order, classes packaged in an older version of FOP library from the platform are still loaded via service provider mechanism.

It seems we'll have to downgrade FOP to 0.9.x as a workaround for now.

mysticfall commented 10 years ago

Unfortunately, I found that downgrading to 0.9.x is not viable as that version has serious bug with multi-page table.

There's nothing we can do till Pentaho decides either to remove or upgrade its own version of FOP library.

mysticfall commented 10 years ago

Posted an upstream issue report here :

mysticfall commented 10 years ago

It seems that the bug is fixed with Pentaho BI 5.1.0. We'll close this issue once that version is released and tested.

mzko commented 7 years ago

What about "when exporting to pdf had problems with Russian encoding - instead of Russian letters were ###" ? This issue is not fixed yet (