jsreport browser client
npm install @jsreport/jsreport-browser-clientAdds recipe html-with-browser-client which creates html output with attached jsreport browser client script.
The html output is then extended with jsreport global object. That can be used to invoke jsreport server rendering directly from the output report.
See the browser-client for API documentation.
html
Hello world
`
Drill down to sub report
Also very common scenario. The report is too complex to display at once and you want let the users to drill down to particular sections.The master template can contain several links to the detail drill down. Every link can then render different template and also push additional information through data property.
`html
Hello from master....
`The detail template can use data provided from the master template or use custom script to actively fetch required data. There can be also
back button for navigating back to the master template.
`html
Hello from detail {{detailId}} ....
`The whole usecase can be implemented also through AJAX calls, this can prevent URL changes.
`js
jsreport.renderAsync({ template: { name: 'master'} }).then(function(r) {
document.open();
document.write(r.toString());
document.close();
});
`
Editable templates
The last example shows how to use the jsreport borwser client to edit and preview the template in third party WYSIWYG editor.`html
`Changelog
$3
- minimum node.js version is now 22.18.0$3
- internal changes to support new
response.output api$3
- minimum node.js version is now
18.15.0`- fix url normalization. it was breaking playground serverUrl
- changes to enable caching of system helpers