PDF Export in Salesforce

By | November 8, 2013

As Salesforce developers, we know that salesforce has the feature to render a page into PDF format using renderAs=”pdf” in <apex:page> tag feature. Few days back we had gone through a situation where we wanted to allow users to enter input and based on that input PDF document should be downloaded without redirecting to another page.

In main page we need to set the value of exportDataString. The exportDataString is the text/html that you need to export that we are assigning in JavaScript .

New Stuff Changing the date range in standard Salesforce Calendar

Below is sample code for main VF page and its controller.Fig.1Next we create a pdfdemowrapper Page that will be returned to the main page to download the data in PDF format.

We need to create another page called demo_pdfexport showing the contents of exportDataString . Note that we have used the set escape attribute to false.

Fig.2.Soon we will be writing another Blog post for Export to excel in Salesforce.

About Us
Greytrix as a Salesforce Product development partner offers a wide variety of integration products and services to the end users as well as to the Partners across the globe. We offers Consultation, Configuration, Training and support services in out-of-the-box functionality as well as customizations to incorporate custom business rules and functionalities that requires apex code incorporation into the Salesforce platform.

Greytrix has some unique solutions for Cloud CRM such as Salesforce integration with Sage Enterprise Management (Sage X3), Sage Intacct, Sage 100 and Sage 300 (Sage Accpac). We also offer best-in-class Cloud CRM Salesforce customization and development services along with services such as Salesforce Data Migration, Integrated App development, Custom App development and Technical Support to business partners and end users.

Greytrix GUMU™ integration for Sage ERP – Salesforce is a 5-star app listed on Salesforce AppExchange.

For more information, please contact us at salesforce@greytrix.com. We will be glad to assist you.

Related Posts