Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in docx-Export #8

Closed
TorstenBMR opened this issue Aug 30, 2022 · 3 comments · Fixed by #40
Closed

Exception in docx-Export #8

TorstenBMR opened this issue Aug 30, 2022 · 3 comments · Fixed by #40
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@TorstenBMR
Copy link

Exporting a grid to docx without template:

java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "o" is null
	at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:57) ~[na:na]
	at java.base/jdk.internal.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:36) ~[na:na]
	at java.base/java.lang.reflect.Field.get(Field.java:425) ~[na:na]
	at com.flowingcode.vaadin.addons.gridhelpers.HeaderFooterGridHelper.getTemplate(HeaderFooterGridHelper.java:22) ~[grid-helpers-0.2.0.jar:0.2.0]
	at com.flowingcode.vaadin.addons.gridhelpers.HeaderFooterGridHelper.getFooter(HeaderFooterGridHelper.java:64) ~[grid-helpers-0.2.0.jar:0.2.0]
	at com.flowingcode.vaadin.addons.gridhelpers.GridHelper.getFooter(GridHelper.java:308) ~[grid-helpers-0.2.0.jar:0.2.0]
	at com.flowingcode.vaadin.addons.gridexporter.BaseInputStreamFactory.lambda$getGridFooters$1(BaseInputStreamFactory.java:61) ~[grid-exporter-addon-1.0.1.jar:1.0.1]
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[na:na]

@TorstenBMR TorstenBMR changed the title Exceptions Exception in docx-Export Aug 30, 2022
@mlopezFC
Copy link
Member

Hi! ... thanks for reporting this!
Can you supply a snippet of your code to reproduce this issue?
I tried it without a footer (because based on the stack trace that you provided it seems that the problem is related to obtaining the footer from the grid), but I couldn't reproduce it.
Regards.

@TorstenBMR
Copy link
Author

Hi, thanks for quick reply.
The problem occurs when you create the GridExporter after the grid is attached to the UI. I changed it in my code, so that the GridExporter is created immediatly when the grid is created (before attach) and it works fine.

@mlopezFC
Copy link
Member

I tried to reproduce the issue by doing that, but it doesn't work. I will document that it should be used in that way (creating it before attaching the grid).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Development

Successfully merging a pull request may close this issue.

3 participants