tianchiing / xdocreport

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

Can I iterate an dynamic image with an iterator? #473

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I need to show a list of dynamic images

«[#list produtos as produto]»

    Image with an anchor (produtosImagem)

«[/#list]»

gabarito2.docx has an example.

I get the exception:

11:32:17,705 DEBUG cache:45 - Loading template for 
"fr.opensagres.xdocreport.document.docx.DocxReport@6d5d2cc!word/document.xml"("p
t_BR", UTF-8, parsed) from 
"fr.opensagres.xdocreport.core.io.XDocArchive$XDocArchiveEntryInfo@28c1adea"
11:32:17,958 ERROR runtime:60 - Error executing FreeMarker template
FreeMarker template error:
For "." left-hand operand: Expected a hash, but this evaluated to a sequence 
(wrapper: f.t.SimpleSequence):
==> produtos  [in template 
"fr.opensagres.xdocreport.document.docx.DocxReport@6d5d2cc!word/document.xml" 
at line 4, column 330]

----
FTL stack trace ("~" means nesting-related):
    - Failed at: #assign ___imageInfo = ___ImageRegist...  [in template "fr.opensagres.xdocreport.document.docx.DocxReport@6d5d2cc!word/document.xml" at line 4, column 277]
----

Java stack trace (for programmers):
----
freemarker.core.NonHashException: [... Exception message was already printed; 
see it above ...]
    at freemarker.core.Dot._eval(Dot.java:45)
    at freemarker.core.Expression.eval(Expression.java:78)
    at freemarker.core.ListLiteral.getModelList(ListLiteral.java:95)
    at freemarker.core.MethodCall._eval(MethodCall.java:60)
    at freemarker.core.Expression.eval(Expression.java:78)
    at freemarker.core.Assignment.accept(Assignment.java:70)
    at freemarker.core.Environment.visit(Environment.java:312)
    at freemarker.core.MixedContent.accept(MixedContent.java:62)

freemarker.core.NonHashException: For "." left-hand operand: Expected a hash, 
but this evaluated to a sequence (wrapper: f.t.SimpleSequence): ==> produtos 
[in template 
"fr.opensagres.xdocreport.document.docx.DocxReport@6d5d2cc!word/document.xml" 
at line 4, column 330] ---- FTL stack trace ("~" means nesting-related): - 
Failed at: #assign ___imageInfo = ___ImageRegist... [in template 
"fr.opensagres.xdocreport.document.docx.DocxReport@6d5d2cc!word/document.xml" 
at line 4, column 277] ----

   Ricardo Fraga Camelo

Original issue reported on code.google.com by ricardof...@gmail.com on 15 Apr 2015 at 2:33

Attachments: