Components/childTemplate content Using API
-
I want to create document structure that will include:
- Cover Page
- TOC
- Page numbers
the actual content of the document is a dynamic Template so using Components/childTemplate looks like the best option.
Another requirement is that the Component/childTemplate body will be provided from a API call .
Using the playground example for Components/childTemplate looks like the actual content is store in the DB.
Here are my questions ?- Use Components OR childTemplate ? what will be the best option
- Use beforeRender script to update the Component/childTemplate ? for the budy
- How to create the Page numbers
- How to create the TOC
Thank you for the help
-
Another wild option is using Docx as the base template, so Page number + TOC will be cover ,
The content will be html that will be create in a beforeRender script ..
-
The documentation mentiones two approaches on how to render ToC with page numbers. Both approaches have linked playground demo
https://jsreport.net/learn/pdf-utils#toc-table-of-contentsYou can also look at the stock showcase demo. That has the same requirements like you.
https://playground.jsreport.net/w/admin/S3xqZ0ZcIf you get to a specific problem, don't hesitate to ask for help.