I have a story where I need to create a PDF document. Within this PDF, I need to incorporate multiple fields and grids. While the fields are functioning properly, I encountered an error when attempting to dynamically add grids. Interestingly, there are no errors apparent in the XML structure. However, during the process of converting the XML to PDF, an error arises.Error:
freemarker.core.NonStringOrTemplateOutputException: For "${...}" content: Expected a string or something automatically convertible to string (number, date or boolean), or "template output" , but this has evaluated to a sequence+hash (wrapper: f.e.dom.NodeListModel):==> wo.@vendorName [in template "fr.opensagres.xdocreport.document.docx.DocxReport@322fce7b!word/document.xml" at line 4, column 28085]
----Tip: This XML query result can't be used as string because for that it had to contain exactly 1 XML node, but it contains 0 nodes. That is, the constructing XML query has found no matches.----
----FTL stack trace ("~" means nesting-related): - Failed at: ${wo.@vendorName} auto-escaped [in template "fr.opensagres.xdocreport.document.docx.DocxReport@322fce7b!word/document.xml" at line 4, column 28083]----Please anyone let me know any modification so i will apply those changes
Discussion posts and replies are publicly visible
I think the best way to create PDF is this: appian.rocks/.../
Okay , But it is lengthy there is not other way to do it. I am doing this by this way using subtitute.
I have an given template to dynamic this template i am creating expression rule !!!
I am getting error perticularly in grid items before and after
Hi Ankush,
Have you done the expression rule for the above dynamic template, can you please share?
Thanks in advance
/*For Example doc.DocumentPrefix.value1*/ a!localVariables( substitute( "<DocumentPrefix> <value1>" & todate(now()) & "</value1> <value2>" & "" & "</value2> <value3>" & todate(now()) & "</value3> <value4>" & "" & "</value4> <value5>" & "" & "</value5> <value6>" & "" & "</value6> <value7>" & "" & "</value7> <value8>" & "" & "</value8>" & "</DocumentPrefix>", "&", "&" ) )
rajnis1428 , You need to map the DOCX variable the same way I added 'DOC.Prefix.YourVariable' into the code.