Docx from dynamic template

I am trying to implement docx from dynamic template smart service which is a shared component.

It is having 3 mandatory parameters.
1. Document template
2. Xml Datamodel
3. Savein folder

I am trying to create a cdt name project which contains 3 parameters "name", "dob", "address".
I tried with the below xml model. For hardcoded values it is working fine, but for dynamic values(pv parameters) it is nor work.

="<project >
<name='&pv!name&' dob='&pv!dob&' address='&pv!address&'/>
</project>"

Can anyone suggest the document template and xml Datamodel for the same?

Thanks in advance.

OriginalPostID-258940


wordTemplateForDynamicGeneration.docx

  Discussion posts and replies are publicly visible

Parents
  • Thanks @christopherb225
    But it is throwing a error message while running the process model but the process is completed.

    error : freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:==> ___HyperlinkRegistryword_document_xml.hyperlinks
    [in template "fr.opensagres.xdocreport.document.docx.DocxReport@53627cec!word/_rels/document.xml.rels" at line 1, column 1404]
    Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use [#if myOptionalVar??]when-present[#else]when-missing[/#if].
    (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault,
    (myOptionVar.foo)??The failing instruction:==> #list ___HyperlinkRegistryword_docume... [in template "fr.opensagres.xdocreport.document.docx.DocxReport@53627cec!word/_rels/document.xml.rels" at line 1, column 1397]
Reply
  • Thanks @christopherb225
    But it is throwing a error message while running the process model but the process is completed.

    error : freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:==> ___HyperlinkRegistryword_document_xml.hyperlinks
    [in template "fr.opensagres.xdocreport.document.docx.DocxReport@53627cec!word/_rels/document.xml.rels" at line 1, column 1404]
    Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use [#if myOptionalVar??]when-present[#else]when-missing[/#if].
    (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault,
    (myOptionVar.foo)??The failing instruction:==> #list ___HyperlinkRegistryword_docume... [in template "fr.opensagres.xdocreport.document.docx.DocxReport@53627cec!word/_rels/document.xml.rels" at line 1, column 1397]
Children
No Data