How to group by line items in the PDF Template?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Triggerz
    Senior Member
    • May 2024
    • 142

    #1

    How to group by line items in the PDF Template?

    Hi,

    I have 2 entities with one-to-many relationship. The entity CashAR is the parent entity and the CashARItems is the child entity. The child entity has an field named artype.

    In the PDF Template, I am able to diplay the details of the Parent entity and the related child entity records. I wanted to group the child entity records based on their artype and provide a subtotal for each group. How can I do this in the PDF Template?

    Thanks & Regards...

  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9672

    #2
    Hello,

    It's not possible to have sub-totals for each group out of the box.

    If the group value list is static, you can iterate through items the each group, having an x-if for each group.

    Comment

    • Triggerz
      Senior Member
      • May 2024
      • 142

      #3
      Thanks for your response Yuri. Can this feature be possibly include in future releases?

      Comment

    • Triggerz
      Senior Member
      • May 2024
      • 142

      #4
      Thanks Yuri

      Comment

      • alohatech
        Junior Member
        • May 2024
        • 28

        #5
        You can create a custom bridge between the CRM and a dedicated "print-ready" page. The Logic in 3 Steps:
        1. The Trigger (Button/Link): You add a button in the EspoCRM interface. When clicked, it grabs the current record's ID and opens your custom file in the public/ folder (e.g., yoursite.com/print.php?id=123).
        2. The Data Fetch (API): Your PHP file in the public/ folder is a standalone script. It uses that ID to reach back into EspoCRM via the API to "pull" the specific data (names, dates, totals) for that record.
        3. The View (HTML/JS): Once the data is fetched, your script injects it into a clean HTML template. A simple Vanilla JS command (window.print()) then automatically triggers the browser's print dialog as the page loads.

        Comment


        • yuri
          yuri commented
          Editing a comment
          Better to stick to application level solutions.
      Working...