Generating and Printing Invoice/Document from Portal Page

Posted by ithrees on 27-Aug-2014 03:05

Hi All,

I have a situation where an authenticated portal user can fill a form to create a request record and then he should be able to get a print that as a document with the help of templates like generating and printing an invoice of a placed order. 

I tried this with the template field but it doesn't have a print button to print. Is there a way to do this with reports? or any other way to achieve this purpose please..?

Thanks and Regards,
Ithrees 

All Replies

Posted by Orchid Corpin on 28-Aug-2014 11:25

Hi ithrees,

To add print button on portal pages, go to the edit page and add a script component, edit the script component and paste the code below:

<style media="print">
#printBtn {
   display: none;
}
</style>

<button id="printBtn" class="btn btn-info" onclick="window.print();"> <i class="icon-print"> </i> Print </button>


We need the CSS media = "print" so that the print button will be hidden during the actual printing and print preview.

Note: Since Pollbase uses bootstrap you can choose some of the button styles here, just change the class attribute value: http://getbootstrap.com/2.3.2/base-css.html#buttons

Hope this may help.

Regards,

Orchid

Posted by ithrees on 29-Aug-2014 01:10

Thanks Orchid,

This is very helpful to me, adding another question for this purpose, printing a single record what could be the best way to choose between template field and report? If report, How we can create a view (as we loop through views in reports) for that single record in portal page to print with the report template ?

Thank you again.

Ithrees

Posted by Orchid Corpin on 29-Aug-2014 11:34

Hi ithrees,

You can have this via Document Template field, this will enable you to display and print per record basis and also have the option to convert to PDF.

To do this:

1. Create first a Template > New Document Template (in the creation page you can check the "Render as PDF")

          

2. Upload you HTML file then save

3. Create a new Field with the type Document Template (you will assign here your newly created Template) so this can be displayed per record

4. Make sure to set the Default Template and check the checkbox below it

5. You can show the field as one of the list view column or in the view page as normal field, this is clickable and can open the PDF / HTML that is ready for printing

Hope this may help.

Regards,

Orchid

Posted by ithrees on 30-Aug-2014 23:37

Thank you Orchid,

Yes, It helped me a lot.

Thank you again.

Ithrees

This thread is closed