Dynamic File Name for Exported PDF

By | March 1, 2014

Earlier we had posted couple of blogs on export feature in salesforce. They are Excel Export in Salesforce and PDF Export in Salesforce. In these blogs we have provided information on how to export the data in excel and pdf format.

While exporting the data to pdf or excel format some name is assigned to the exported file by default. As an alternative to this, we can dynamically set the file name that needs to be exported.

To achieve this, we created a property called FileName in the controller as shown below –cont1Then we set FileName value through visualforce page using Javascript code as highlighted in below screenshot –cont2We then add FileName property to the contentType attribute of apex:page tag as shown below –cont3

Using the above approach, we can dynamically set the file name to be used when exporting files in any supported format.

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