Array in array



  • I have sample data:

    {
      "people": [
        {
          "firstname": "Edward",
          "lastname": "Scissorhands",
          "images": [
            "data:image/png;base64,REFDFSAFD....",
            "data:image/png;base64,REFDFSAFD....",
            "data:image/png;base64,REFDFSAFD....",
            .....
          ],
        }
      ]
    }
    

    And want to print all the images in docx writer:

    trying to do this:

    {{#each people}}{{firstname}}{{lastname}}
        {{#each images}}
        Dummy image with "screen tip": {{docxImage src=images}} and bookmark to images
        {{/each}}
    {{/each}}
    

    Also tried

    {{#each people}}{{firstname}}{{lastname}}
        {{#each images}}
        Dummy image with "screen tip": {{docxImage src=people.images}} and bookmark to images
        {{/each}}
    {{/each}}
    

    Any hint?



  • Hm, seems the forum does not recpect intendations - sorry for the bad reading :(



  • I updated your post with a markdown highlight. See this article how this can be done in the future....



  • It seems you have just problems with handlebars?
    This should work

    {{#each people}}{{firstname}}{{lastname}}
        {{#each images}}
              Dummy image with "screen tip": {{docxImage src=this}} and bookmark to images
        {{/each}}
    {{/each}}
    


  • src=this solved the issue! Thank you once again for the quick support!


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.