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
RohithaSfdcRohithaSfdc 

How to configure save Button as Mutiaction (Save & Export page data in Excel)

How to Convert single button as Save & ExportHI Thanks in advance,
How to Convert single button as Save & Export as Excel sheet in local machine , I want Convert Save button as multi actions.

User-added image
This above page allows the user enter text data when user clicks on save button it will save data & export data in Excel sheet. Please help me over this code. i want controller clas for this . please share workable Apex code for this.
 
<apex:page sidebar="false" StandardController="Account" standardstylesheets="false" rendered="true" docType="html-5.0">
  <apex:form > 
            <apex:pageBlock >
                <apex:pageBlockButtons >
                    <apex:commandButton action="{!save}" value="Save"/>
                </apex:pageBlockButtons>
      <table id="newspaper-b" border="" width="100%">    
          <thead>  
                
             <tr>
                <td>Value1</td>
                <td>Value2</td>      
                <td>Adding Value</td>
            </tr>                    
          </thead>
         <tr>
           <td><apex:inputText style="width:60px;height:20px"/></td>                
            <td><apex:inputText style="width:60px;height:20px"/></td>
            <td><apex:inputText style="width:60px;height:20px"/></td>                 
          </tr>
          
         <tr>
            <td><apex:inputText style="width:60px;height:20px"/></td>      
            <td><apex:inputText style="width:60px;height:20px"/></td>
            <td><apex:inputText style="width:60px;height:20px"/></td>                   
          </tr>
          
         <tr>
            <td><apex:inputText style="width:60px;height:20px"/></td>      
            <td><apex:inputText style="width:60px;height:20px"/></td>
            <td><apex:inputText style="width:60px;height:20px"/></td>
         </tr>
        </table>
       </apex:pageBlock>
</apex:form>
</apex:page>

I have used both Controller class & Vf page unable to Export the data. Please share the code if you have.

Thanks
 
Yogesh KulkarniYogesh Kulkarni
Hi Rohitha,

From commandbutton save the data from a method which is returning the PageReference then in the return statement put a visualforce page to export the details required. For excel export use following link.
https://help.salesforce.com/apex/HTViewSolution?id=000003176

Thanks,
Yogesh
Rahul SharmaRahul Sharma
Avoid posting same query in multiple posts:
https://developer.salesforce.com/forums/?id=906F0000000BQ43IAG
https://developer.salesforce.com/forums/?id=906F0000000BQ3oIAG