Template PDF | add button in Group or Repeated Group and generate PDF

marcq

Member
Hi,

I'm generating PDF's in several of my projects with the Form PDF template, which works fine.

Now I would like to generate PDF's from one of

my form group

upload_2017-2-20_11-31-10.png

and another one (into the same form) from a repeated group

upload_2017-2-20_11-31-55.png

In need to create in each of those groups a button that is triggering a different PDF template. Is it possible ? If yes could you please explain me shortly how I could proceed ?

Thanks in advance for your support. Cheers, marc
 
Thanks troester, you gave me the solution, cool, cheers, marc

Solution :

1. I have created a details view PDF template
2. which is located into the components/com_fabrik/views/details/tmpl folder
3. The name of the template is "bootstrap_printinvoice_fe"
4. I have created a button element into my group
5. I wrote this short JavaScript function
6. I have added this JavaScript function into an on-click Inline JavaScript Code of my button element : printInvoicefe();

Javascript function is :

JavaScript:
function printInvoicefe() {

  // GET FORM REFERENCE
  var form = Fabrik.getBlock('form_59');

  // GET THE NEEDED VAR
  var form_nr = 59;

  var memberid = form.formElements.get('gprh_fabrik_user_registration___id').getValue();

  // GENERATE THE PDF INVOICE
  window.open('http://www.domain.com/index.php/gestion-membres-2/gestion-membres/membres-actifs-2/membres-actifs-attente-paiement/details/' + form_nr + '/' + memberid + '?format=pdf&layout=bootstrap_printinvoice_fe');
  };
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top