StimVinsh / xdocreport

Automatically exported from code.google.com/p/xdocreport
0 stars 0 forks source link

Support optional images in a report #95

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. add an image field (fieldsMetadata.addFieldAsImage("image"))
2. do NOT put image provider in the context
3. report breaks with  java.lang.NullPointerException: null
    at fr.opensagres.xdocreport.document.images.AbstractImageRegistry.getWidth(AbstractImageRegistry.java:160)

What is the expected output? What do you see instead?

It would be nice to mark the field as ignored if there is no mapping in the 
context. That way the image in the template would remain.

What version of the product are you using? On what operating system?

v0.9.6

Please provide any additional information below.

I tried side-stepping the issue by adding an image field, generating a report 
and then removing the field from the metadata.getFieldsAsImage() collection for 
each specific context, only to find out that that collection is unmodifiable :)

Original issue reported on code.google.com by alh84001...@gmail.com on 22 Mar 2012 at 12:33

GoogleCodeExporter commented 8 years ago
Hi,

I agree with you: image support must be improved to manage the case when 

1) image provider is not putted in the context 
=> keep the original document with the "template" image. 

2) image provider returns null input stream.
=> a) keep the original document with the "template" image. 
=> b) or remove the content of the "template" image. (none image is displayed).

To know which option must be done (a) or b)), IImageProvider could returns this 
option.

Regards Angelo

Original comment by angelo.z...@gmail.com on 22 Mar 2012 at 1:13

GoogleCodeExporter commented 8 years ago
Hi,

Optional image will be available in the 0.9.7 (we plan to release it this week 
end). 

* for docx please read 
http://code.google.com/p/xdocreport/wiki/DocxReportingJavaMainDynamicImage#Optio
nal_Image

* for odt please read 
http://code.google.com/p/xdocreport/wiki/ODTReportingJavaMainDynamicImage#Option
al_Image

Regards Angelo

Original comment by angelo.z...@gmail.com on 29 Mar 2012 at 8:46

GoogleCodeExporter commented 8 years ago
Hi,

It's great to hear this, and it looks really nice to use. Can't wait for the 
release, many thanks.

Original comment by alh84001...@gmail.com on 29 Mar 2012 at 9:04