MohamedSaeed / xdocreport

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

Images in DOCX misbehave in a foreach loop #462

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If an image is part of a list but is not contained within one row in a table, 
it misbehaves. By that I mean, if the list class is registered as a list with 
FieldsMetadata, every image in that list is repeated for each row. This 
reporting system, I should state, is really really damn good and I like how 
fast and easy it is to use. Setting the listType field to false results in no 
image being found.

JAVA > metadata.load( "mylist" , MyRecord.class, true );
JAVA > context.put( "mylist", listOfRecords );

#foreach ( $item in $mylist )
--------------------------------------------------------------------------------
----------------------
$item.Name                  |  $item.Location
--------------------------------------------------------------------------------
----------------------
{BOOKMARK-IMAGE}
#end

The result for a 3 item list will be...

--------------------------------------------------------------------------------
----------------------
Item 1                  |  My Location
--------------------------------------------------------------------------------
----------------------
{IMAGE-1}
{IMAGE-2}
{IMAGE-3}

--------------------------------------------------------------------------------
----------------------
Item 2                  |  My Location
--------------------------------------------------------------------------------
----------------------
{IMAGE-1}
{IMAGE-2}
{IMAGE-3}

--------------------------------------------------------------------------------
----------------------
Item 3                  |  My Location
--------------------------------------------------------------------------------
----------------------
{IMAGE-1}
{IMAGE-2}
{IMAGE-3}

Original issue reported on code.google.com by dma...@shelbrook.com on 17 Jan 2015 at 8:38

Attachments:

GoogleCodeExporter commented 9 years ago
xdocreport-1.0.4
velocity-1.7

Original comment by dma...@shelbrook.com on 17 Jan 2015 at 8:42

GoogleCodeExporter commented 9 years ago
XDocReport was not designed to support complex table. 

To be honnest with you, I have no time to study your case, perhaps XDocReport 
should be improved? Any contribution are welcome!

Please note that now we use github 
https://github.com/opensagres/xdocreport/issues

Original comment by angelo.z...@gmail.com on 17 Jan 2015 at 8:54

GoogleCodeExporter commented 9 years ago
RESOLVED thanks to the comments in Issue 255. It's not an obvious solution so 
perhaps a new example would benefit others?

https://code.google.com/p/xdocreport/issues/detail?id=255

Original comment by dma...@shelbrook.com on 17 Jan 2015 at 9:01

GoogleCodeExporter commented 9 years ago
Thanks Angelo, I had started to look into how xdocreport is built to see if I 
could contribute. I had seen the code on GitHub but missed that issues had 
moved too.

Anyway, your notes from the past helped me solve the immediate need here. 
Cheers!

Original comment by dma...@shelbrook.com on 17 Jan 2015 at 9:04

GoogleCodeExporter commented 9 years ago
Glad you have fixed your problem. Hope you will understand that I'm very busy 
today to give a support for each use cases of report. But I think XDocReport is 
mature today. If it must be improved, any contribution are welcome!

Original comment by angelo.z...@gmail.com on 17 Jan 2015 at 9:39