jsreport core - how to reference #child template



  • If content contains #child childTemplateName, how to I pass in the childTemplateName in the render call as well? Please see render snipped below.

    jsreport.render({
    template: {
    content: content.toString(),
    helpers,
    phantom: {
    footer: name === 'codered' ? footer.replace('{{now}}', '') : footer,
    header: header.toString(),
    headerHeight: '4cm',
    footerHeight: '1cm',
    format: 'portrait',
    margin: '{"top" : "0px", "right" : "0px", "bottom" : "0px", "left" : "0px"}'
    },
    engine: 'handlebars',
    recipe: 'phantom-pdf'
    },
    data
    })));


  • administrators

    hi! there is no way to define child templates in inline form, you would need to programmatically add the child templates first with a name and then use it in .render(), see here for an example of how to register the child template programmatically


Log in to reply
 

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