How can I make a report that does not separate each item into different pdf files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nocstaff@urbancom.net
    Member
    • Jul 2025
    • 50

    #1

    How can I make a report that does not separate each item into different pdf files

    I’m trying to generate a PDF report of Cases/Projects in EspoCRM with custom HTML styling.
    • If I use a case/project entity template, Espo generates one PDF per record and zips them.
    • If I use a report entity template, I get one file, but I can’t seem to apply my own styling — HTML either comes out as plain text or the #each iterator produces nothing.

    Is there a way to create a single styled PDF that lists multiple Cases/Projects at once? Or does this require backend changes? I added a few screenshots of some things I tried on my own.
    Attached Files
  • victor
    Active Community Member
    • Aug 2022
    • 998

    #2
    You can use your PDF template for Case and select many records in a row in List view and it will all print in one big PDF document. Just install the free extension https://github.com/yurikuzn/ext-tcpdf/releases and select Tcpdf instead of Dompdf​ in Administration > Settings > PDF Engine.

    More about this: https://docs.espocrm.com/user-guide/...f/#engines.​

    Comment

    • nocstaff@urbancom.net
      Member
      • Jul 2025
      • 50

      #3
      Your solution helped out a ton. Thank you for that. Dompdf was causing all kinds of problems, but once I swapped to Tcpdf everything went smooth sailing. Also, I realized using the report entity actually just doesn't work, since it will only ever print everything in rows without letting me add my own custom html to change the formatting of the information. It comes with it's own issues, but I was able to progress much more because of that change.

      I am still having trouble with the each iterator though. It seems like no matter what I do, I just can't get it working. It's important to get this working because I need to make a report for projects that includes all project tasks, and I think the each iterator is the best and maybe even only solution for that. Do you know how I can get this fixed?

      Comment

      • nocstaff@urbancom.net
        Member
        • Jul 2025
        • 50

        #4
        I was able to fix the each iterator on my own. I don't think each actually applied to my situation when I was making case reports, which is probably why it always resulted in a blank response. As for projects and project tasks, I realized I was using "projectTasks" when in my system it's actually called "tasks" which was probably the issue.

        In case it helps anyone with a similar issue, I will post my own HTML block using the each iterator

        HTML Code:
        <h3>Tasks</h3>
        <table border="1" cellpadding="5" cellspacing="0" width="100%">
          <thead>
            <tr>
              <th style="font-weight:bold;">Task Name</th>
              <th style="font-weight:bold;">Status</th>
              <th style="font-weight:bold;">Priority</th>
            </tr>
          </thead>
          <tbody>
            {{#each tasks}}
              <tr>
                <td>{{name}}</td>
                <td>{{status}}</td>
                <td>{{priority}}</td>
              </tr>
            {{/each}}
          </tbody>
        </table>

        Comment

        Working...