function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sfdc_dev123sfdc_dev123 

Exporting vf page selected records in a excel file

Hi,

 

I have developed a vf page displaying records with checkboxes. I have two buttons in my page

EXOPT and EXPORTALL. My vf page data exoprting all data clicking on exportall.

But i want to export selected records. Any ine can help?

 

 

Thank you.

SammyComesHereSammyComesHere

You need to either create a wrapper which would have an ischecked boolean property that would be used as value for check boxes and then when you make a post back get the list of id's(wrapper Objects) and pass those to a VF page with content type as excel.

 

Else 

 

Make use of a standard set Controller and use the get selected property to get selected records and then pass those to a VF page and using apex:repeat get it in a table Page block and set content type for that VF page as excel.

sfdc_dev123sfdc_dev123

Hi sammy,

 

 

Thank you for your reply. Can you please give a sample code?

am passing a set(record ids) checked records from pagereference to other page

but how to retrieve that values in that page.

 

 

Thank you