Docx from Dynamic template

Certified Senior Developer

hi i want to create a template and xml data model for Docx from dynamic template. how to code that. and how to create the template. can i get an idea? 

it should be like letter. 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hello  

    We can show some Ideas only if you give us more information.
    1. What is the content? 

    2. Will it contains tables or any other images?

    3.Does it have any dynamic content?

    4. What are the fields that will change or update dynamically?

  • 0
    Certified Senior Developer
    in reply to Konduru Chaitanya

    It should be like this. all the names, address, mobile number all those should be dynamic values. I want know how to config template and xml model for them

  • 0
    Certified Senior Developer
    in reply to thiliniumesha

    Your Word Template would look something in this way

    Do not want to provide the actual file since it would only affect your learning.

    You will have to pass the data using the varable. Your values in the doc will be defined in this format doc.VariableName.field .

    you will need to construct the data in a expression rule in the below format (Example). Please refer and write your own expression.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    = "<letter>" &
    "<date>" & text(ri!letter.date,"yyyy-mm-dd") & "</date>" &
    "<name>" & ri!letter.name"</name>" &
    /*other fields in a non ultiple variable*/
    a!forEach(
    items: ri!names/*Variable that contains the list of data in the Table*/,
    expression: "<names" &
    " name=" & "'" & fv!item.name & "'" &
    " lastName=" & "'" & fv!item.lastName & "'" &
    " mail=" & "'" & fv!item.mail & "'"&
    " />"
    ) & "</letter>"
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Please do more research on how to write XML and DOCX template which would help you explore more ways of creating a dynamic doc

  • 0
    Certified Senior Developer
    in reply to Konduru Chaitanya

    I will try this. Thank you for the help.

  • 0
    Certified Senior Developer
    in reply to Konduru Chaitanya

    in here it is not going to generate the document. not showing any error. but document is not generating.

  • 0
    Certified Senior Developer
    in reply to thiliniumesha

    Could you please show the Expression you have wrote and also the smart service configuration.

  • 0
    Certified Senior Developer
    in reply to Konduru Chaitanya

    Re: Crest Nicholson Operations Limited

    Property: <<${doc.project.headding2}>>

     

    this is the template and following one is the xml model

    "<project><headding2>aaaaaaaa</headding2></project>"

    what is the issue here? why the document is not generating

  • 0
    Certified Senior Developer
    in reply to thiliniumesha

    Node configuration please. and a screenshot of your process would also help.

  • 0
    Certified Senior Developer
    in reply to Konduru Chaitanya

    fixed. Issue was not configure the fields in the template. thanks 

Reply Children