^ Click Here
Showing posts with label excel. Show all posts
Showing posts with label excel. Show all posts

Saturday, January 14, 2012

To get a list in different format as HTML / excel / pdf / word in Salesforce

More often than not we need to have an option where we can get a list in an excel or HTML or pdf format....specially for sending it in e-mails.

These formats are standards and presentable hence much desired most often than not.

I did an example where I can show a list of Contacts, Owner name and corresponding Accounts Name with the option to retrieve/download it in excel/HTML/pdf/word format (I tried for picture format also but it didn't work)

Things to notice are

- The file is downloaded with the current date in the name for the ease of distinguishing.

- In the controller the transient variable is being used so that it can show maximum number of records without the view-state error.

- The table is given different background colors for differentiation between rows but each format reads it differently so there is a variation.

Also this is just a raw presentation and a starter.....much can be improved upon this and different functionality or options can be added/modified into it.....

Click here for a demo of this.

The page (visualforce) code -