You need to sign in to do that
Don't have an account?
Shobhit T
Display records in an excel sheet
I have two objects : 1. Assigned_Task__c object
2. Migration_Report__C object 1 is parent of 2
I have a custom button on Assigned Task object Generate Migration List My requirement is when i click on this button all the related records to one particular task are exported to excel sheet. As you can see below i have this button , so when i click on this i want that the information in the related record comes in an excel sheet. Can anyone please help me with this code. Thanks in advance.
2. Migration_Report__C object 1 is parent of 2
I have a custom button on Assigned Task object Generate Migration List My requirement is when i click on this button all the related records to one particular task are exported to excel sheet. As you can see below i have this button , so when i click on this i want that the information in the related record comes in an excel sheet. Can anyone please help me with this code. Thanks in advance.
You beed to create a VFpage and a class related to that VF page .
On click of that button you can load that page and get the task Id from the URl and get related Migration_Report records in alist and iterate in the page through repeat and in teh page add contentType="application/vnd.ms-excel Demo.xls" .
It will down load an excel sheet sheet .If you want to change teh Name dynamically you can .
Thanks
Manoj
Thanks for your valuable time in replying to my question.
I have tried that before like this, but still its not working. If you can share some code that will be helpful.
Regards,
Shobhit
is it possible to share your code ,I will update your code .
I was able to do it. But what now i require a list view button where i can check the records and click on the Generate Excel button to generate excel of that records only which i have checked.
Like in my accounts view , i check the accounts and click on an excel button i get data for those checked accounts only.
Any idea how i can do this ? Thanks for your time.
To get the selected record in your page you need to add recSetVar attribute in page ,Once you will add that system will ask to create a constructor with ApexPages.StandradSetController as argument .Then in standardSetController class there is method getSelected() which will give you selected record list .
Try code like below Let me know any issue .