Answers.Body: <p>If you <a href="https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-report" rel="nofollow noreferrer">make a civireport</a> then you can have the tpl use any layout you like. You could have it extend the lineitem report and then only update the tpl.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-07-10T14:54:28.727Z
Answers.LastActivityDate: 2024-07-10T14:54:28.727Z
Answers.UserDisplayName: Demerit
Body: <p>I have to create 2 PDF file from contribution line items. These reports are called &quot;Libro Soci&quot; (book of members) and they must have precise formatting as these:</p>
  <p><a href="https://i.sstatic.net/JONFKr2C.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/JONFKr2C.png" alt="enter image description here" /></a></p>
  <p>The second report starts from Memberships and displays a summary of all shares and paid-up capital.</p>
  <p><a href="https://i.sstatic.net/BmWv9Gzu.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/BmWv9Gzu.png" alt="enter image description here" /></a></p>
  <p>I could start from <a href="https://civicrm.org/extensions/line-item-report" rel="nofollow noreferrer">Line Item Report extension</a>, but I don't know if it is possible to customize &quot;print&quot; action to use a specific template.</p>
  <p>Alternatively, I was thinking to make an extension that adds a 'Print from template' action that creates a PDF from the search results and asks you for the template to use.</p>
  <p>Can you give me some suggestions? Maybe there is something ready-made.</p>
  <p>Thanks.</p>
  <p>PS: I think I cannot use &quot;Thank-You Letters for Contributions&quot; because it prints a page for every contribution o contract group of contributions. My requirement is to have a single tabular pdf, like an Excel, but customised.</p>
  
Tags: <civireport><custom-reports>
Title: Customize print action to use a template
ThreadText: # Customize print action to use a template
  
  (Asked by: username_0 on 2024-07-10)
  
  I have to create 2 PDF file from contribution line items. These reports are called "Libro Soci" (book of members) and they must have precise formatting as these:
  
  [![enter image description here](https://i.sstatic.net/JONFKr2C.png)](https://i.sstatic.net/JONFKr2C.png)
  
  The second report starts from Memberships and displays a summary of all shares and paid-up capital.
  
  [![enter image description here](https://i.sstatic.net/BmWv9Gzu.png)](https://i.sstatic.net/BmWv9Gzu.png)
  
  I could start from [Line Item Report extension](https://civicrm.org/extensions/line-item-report), but I don't know if it is possible to customize "print" action to use a specific template.
  
  Alternatively, I was thinking to make an extension that adds a 'Print from template' action that creates a PDF from the search results and asks you for the template to use.
  
  Can you give me some suggestions? Maybe there is something ready-made.
  
  Thanks.
  
  PS: I think I cannot use "Thank-You Letters for Contributions" because it prints a page for every contribution o contract group of contributions. My requirement is to have a single tabular pdf, like an Excel, but customised.
  
  **Tags:** civireport, custom-reports
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-07-10. Score: 1 | Accepted answer
  
  If you [make a civireport](https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-report) then you can have the tpl use any layout you like. You could have it extend the lineitem report and then only update the tpl.
  
  
  ---
  
  