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
MriduMridu 

Visualforce to Excel

Hi everyone,

 

i want to export data to excel using vfpage.

So i did like this.i put the content type as  folllows.its working fine.

<apex:page standardcontroller="Quote" contentType="application/vnd.ms-excel" cache="true">
  <apex:pageBlock title="Quotes">
      <apex:pageBlockTable value="{!Quote}" var="q">
         <apex:column />
         <apex:column value="{!q.id}"/>
         <apex:column value="{!q.Name}"/>
         <apex:column value="{!q.Subtotal}"/>
      </apex:pageBlockTable>
   </apex:pageBlock>
 
</apex:page>

 

Currently the filename of the excel and sheet name is my vfpage name-ExportQuotes.But if i want to display the products also in the same file but as different sheet.ie:Quote in Sheet1  and QuoteLine Items in Sheet2 in same page.is it posible.Can anyone help me on this?Its urgent.........

Best Answer chosen by Admin (Salesforce Developers) 
dotnet developedotnet develope

Hi Mridu,

 

with your code its not possible spliting the data from VF page.

one thing i can suggests you, go for Javascript

 

 

All Answers

dotnet developedotnet develope

Hi Mridu,

 

with your code its not possible spliting the data from VF page.

one thing i can suggests you, go for Javascript

 

 

This was selected as the best answer
MriduMridu

hi

 

Thanks for your suggestion.But im nt good at javascript..can u help me on this