-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
I try to use ExcelExporter from leeyt github project based on samchuang github project. (It is the most updated excelexporter that I found on the forum) After compile exporter with zkcommons updated to 8.6 and zpoi to 3.9.7. To fix several issues..
I tried to export a listbox to excel.
With a paging listbox I suffered and exception: java.lang.IllegalArgumentException: <meshelement$internalpaging i9ovr7=""> cannot find tagret (MeshElement) at org.zkoss.exporter.util.Utils.getTarget(Utils.java:39) at org.zkoss.exporter.excel.ExcelExporter.exportCells(ExcelExporter.java:240) at org.zkoss.exporter.excel.ExcelExporter.exportCells(ExcelExporter.java:1) at org.zkoss.exporter.AbstractExporter.exportRows(AbstractExporter.java:207) at org.zkoss.exporter.excel.ExcelExporter.exportTabularComponent(ExcelExporter.java:142) at org.zkoss.exporter.AbstractExporter.export(AbstractExporter.java:237) When I disabled paging mold I can export to excel but only Listhead is export to excel.
What is the best way to export zk grid, listbox or tree to excel in ZK 8.6??
Anybody can help me to update exporter to 8.6?
Thanks in advance.
Hi Ignis11,
Some components structures have changed since the original exporter example. Since it's not an official ZK tool, it's not actively upgraded with the mainline releases.
It's possible to get it running under ZK 8.6, but it requires rewriting some of the export crawl logic.
For example, the org.zkoss.exporter.util.Utils.getHeaderSize(Component) is outdated and will return 0 if you don't have header (since the structure is grid > rows > row, not grid > row). That's not the only place to update, but it should give you an idea of the kind of changes required.
Most methods in the original exporter that are based on component structures need to be updated to match the current component hierarchy.
There is also other factors to consider (such as paging, render on demand, etc...). Since the exporter is based on the mesh component structure (the displayed grid or listbox), it doesn't account for entries in the model that are not currently displayed. There are also ways around this using event sequences, but it's too long for a forum thread.
Bottom line: the actual update to make the exporter run on 8.6 will heavily depends on your project setup and on the use case for the exporter. I'd recommend you contact ZK support for easier communication
Asked: 2018-12-12 16:05:16 +0800
Seen: 23 times
Last updated: Dec 13 '18
NullPointerException Executions.createComponentsDirectly
[Announcement] ZK 8.6 Introductory Session Open for Registration
how to set the global font-size
I configured iceblue_c theme, but it did not work. Please advise. Thank you
request hot fix for CE version for issue ZK-4127
Can you set min-width for columns in the grid that identify hflex=1?