You need to sign in to do that
Don't have an account?
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 construcotr
:
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') ;
<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 construcotr
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') ;
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
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