Closed GoogleCodeExporter closed 8 years ago
In the above case, the outer loop of the template could then be
[#list foo as contract]
...
[/#list]
Original comment by alh84001...@gmail.com
on 8 Mar 2012 at 6:01
Hi,
>First of all I find this project extremely useful and would like to thank
everyone >involved for all the hard work.
Many thanks!
If I understand your need, you want loop for project and generate for each
project:
* information about project.
* list of developpers in a table.
I think to simplify the report you should put in the context list of
ProjectWrapper
* which extends Project.
* define a getter of list of developpers.
1) After you can define at start of your document a list freemarker :
-------------------------------
[#list projects as p]
-------------------------------
2) Don't use FieldsMetadata
Today FieldsMetadata manage list but as you have a context (p), you cannot use
it. So you should use
http://code.google.com/p/xdocreport/wiki/ODTReportingJavaMainListFieldAdvancedTa
ble use @before-row/@after-row in the table like this :
-------------------------------
@before-row[#list developers as p.developers]
...
-------------------------------
But I agrre with you to simplify the report, I think we should improve
FieldsMetadata to set which key is a list or not like this :
-------------------------------
metadata.addKey("p").addList("developers").addKey("name").
-------------------------------
Tell me if @before-row is OK with you.
Regards Angelo
Original comment by angelo.z...@gmail.com
on 9 Mar 2012 at 8:27
That is just what I need. I just skimmed through that page while reading the
documentation and eventually just forgot about it.
I tried to test it, but now I got a really strange error when converting to PDF.
java.lang.NoSuchMethodError: org.odftoolkit.odfdom.converter.internal.itext.stylable.StylableTableCell.setRowspan(I)V
at org.odftoolkit.odfdom.converter.internal.itext.ElementVisitorForIText.visit(ElementVisitorForIText.java:400)
...
I downloaded these two files from the download page and merged them:
odtandvelocity.converters-0.9.6-sample.zip
odtandfreemarker-0.9.6-sample.zip
Browsing the source code of the 0.9.6 tag on GIT I see that indeed the method
setRowspan is being called in ElementVisitorForIText and yet it doesn't exist
in StylableTableCell.
Also I have really simple tables in the document with no merged rows, so I
guess either cells get assigned 1 for rowspan and colspan by LibreOffice or the
converter does some manipulation internally).
I will try to avoid converting and just merge to ODF to see if the merging
itself works.
Original comment by alh84001...@gmail.com
on 9 Mar 2012 at 2:52
java.lang.NoSuchMethodError:
org.odftoolkit.odfdom.converter.internal.itext.stylable.StylableTableCell.setRow
span(I)V
at org.odftoolkit.odfdom.converter.internal.itext.ElementVisitorForIText.visit(ElementVisitorForIText.java:400)
Indded that's very strange. perhaps our distribution is bad? The better mean to
get XDocReport JARs is to use maven =>
http://code.google.com/p/xdocreport/wiki/XDocReport096
Regards Angelo
Original comment by angelo.z...@gmail.com
on 9 Mar 2012 at 3:17
OK, I tried only merging the template with the model and it performed
beautifully :)
Regarding the above error, it was my error. I was using an outdated iText
version, and required methods were added in version 2.1.6.
Thank you for the help.
Original comment by alh84001...@gmail.com
on 9 Mar 2012 at 4:47
Original comment by angelo.z...@gmail.com
on 13 Mar 2012 at 2:41
Original issue reported on code.google.com by
alh84001...@gmail.com
on 8 Mar 2012 at 5:54