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
kundlik Yewalekundlik Yewale 

Apex generated excel not getting correct format any assistance please

Visualforce Page:
<apex:page Controller="PdfGeneratorRedirectController" contentType="application/vnd.ms-excel#SalesForceExport.xls">
"Category","Date","Work Order Number","Pass / Fail"
 <apex:repeat value="{! lstscoring}" var="scring">
 "{!scring.Scoring_Category__c}","{!scring.CreatedDate }","{!scring.Work_Order__r.WorkOrderNumber}","{!scring.Pass_Fail__c}"
 </apex:repeat>
</apex:page>



Controller construcotrAfter Generation:

 lstscoring = new List<Scoring_Record__c>();
           lstscoring = [Select id,name,Scoring_Category__c,Vendor__r.name,Score__c,CreatedDate,Work_Order__r.WorkOrderNumber,Pass_Fail__c from Scoring_Record__c where Vendor__c ='001Z000001LlLGW'];
        System.debug('***** Construc'+ lstscoring +'stscr[0].Vendor__c') ;
Khan AnasKhan Anas (Salesforce Developers) 
Hi kundlik,

I trust you are doing very well.

Please refer to the below links which has sample code which might help you with the above issue. Kindly try to implement according to your requirement.

http://www.appshark.com/how-to-export-data-in-excel-using-visualforce/

http://www.sfdcpoint.com/salesforce/export-excel-multiple-worksheets-visualforce/

https://developer.salesforce.com/forums/?id=906F0000000AzHRIA0

https://help.salesforce.com/articleView?id=000003176&type=1

https://www.supinfo.com/articles/single/6886-salesforce-create-pdf-or-excel-export-with-visualforce


I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in future.

Thanks and Regards,
Khan Anas
Kt YadavKt Yadav
Hi Kundlik Yewale,

Please find below link for your reference.
https://sfdceinstien.wordpress.com/2017/09/09/generate-excel-file-dynamically-from-the-salesforce-record-detail-page/

If it helps you, you can close this query by marking it as solved.

Regards,
Keerti Yadav
kundlik Yewalekundlik Yewale
Hi Someone please let me what is the issue in my code I alredy gone through above link