export custom module to pdf

Hi,

I have created a new custom module on suitecrm 7.1.1.

Now I’d like to export module data to a pdf document, with my personal structure. ( I have to certificate some data and produce this pdf document ).
What are the necessary steps to achieve this? is possible?

Regards,
Rossi

Hi rossi,

To generate PDF’s in custom modules, you need to do the following:

Take a copy of the standard view.detail.php for the module and edit/create a custom view.detail.php in custom/modules/yourmodule/views and add the following:

require_once(‘modules/AOS_PDF_Templates/formLetter.php’);
formLetter::DVPopupHtml(‘yourcustommodule’);

Thanks,

Will.

1 Like

Hi Will,

it works. Here the full steps involved for me (maybe could help someone else):

  1. Edit pdf_template_type_dom dropdown and add MyModule as value

  2. Add custom code for button in custom/modules/MyModule/metadata/detailviewdefs.php
    […]
    array (
    ‘buttons’ =>
    array (
    0 => array(‘customCode’ => ‘’), […]

  3. Create custom/modules/MyModule/views/view.detail.php with the proposed two lines of code:
    require_once(‘modules/AOS_PDF_Templates/formLetter.php’);
    formLetter::DVPopupHtml(‘MyModule’);

  4. Reolad and overrided cache for module ajaxUI ( ctrl+f5 ) on module url

Thanks,
Rossi