Chart as Images into docxtemplater



  • Hi,

    is it possible to render a chart with jsreport, write it into the sampled data object (Base64 encoded) and use it in a second step for docxtemplater (with the Image Module)?

    Thanks!!
    Christian



  • This could work maybe...

    Create a separate template rendering chart into image using chrome-image recipe.
    Then create a beforeRender script hook attached to the main docxtemplater template. There invoke the rendering of the chart template
    https://jsreport.net/learn/scripts#rendering-another-template-from-script
    Use the result buffer, convert it to the base64 and pass it to the req.data in the format expected by docxtemplater.



  • Thank you! This was the solution for my problem. You need the commercial version of docxtemplater, but it works in the online demo.


Log in to reply
 

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