Combine Multiple Reports



  • I'm looking for a way to be able to generate multiple reports into one PDF for easier printing.

    I've always only done single reports in the past and I'm not sure if there is even a way to do this.

    Any help or ideas is appreciated.


  • administrators

    hi! we would also like having a way to merge multiple reports, we think there are valid use cases for a feature like that.

    we had the idea to use something like hummusjs to achieve that, but so far we haven't explored the idea in depth (probably it will be part of our future milestones). if you would like to do experiment with it and need some help let us know!



  • We did look into this matter before too, the easiest way we've found was to use a third party command line tool like poppler (GNU_3 licence) (available on Linux, but some people made an easy to use .exe for windows too!), use a jsreport script to generate all the templates then call the command line at the end of the process to merge them all.

    One cons with that method today is that you can't print page number like currentPage / totalPageOfMergedDocument you can however get the according currentPage for all the document you generate but to achieve that you would need to pass the precedent totalOfPage into each document to be generated.

    hope this can help you :)



  • Sorry to touch on this one again. It's been a while.
    I have a template that is 1 A4 page. in that, I have HTML, BODY HEADERS, CONTENT, FOOTER /BODY /HTML
    If I create an outer template to control my child template example

    {#child ../SharedAssets/CoverPage1 @template.engine=jsrender @template.recipe=html @options.language=sp}
    <div class="page-break"></div>
    {#child ../SharedAssets/CoverPage2 @template.engine=jsrender @template.recipe=html @options.language=sp}
    <div class="page-break"></div>
    {#child ../SharedAssets/CoverPage3 @template.engine=jsrender @template.recipe=html @options.language=sp}

    Does this render each child template separately and then combine them into the PDF (chrome-pdf is being used)
    The output I get looks like the HTML BODY tag wraps all of the child templates... is this the case, we cant use individual HTML, BODY tags in child templates?


Log in to reply
 

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