• UMANG DADHANIYA 4
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Is there any way to create a Dynamic excel document that contains multiple sheets?
<apex:page Controller="contact_output">
    <apex:form id="uma" >
       <apex:pageBlock title="contact"  >
           <apex:pageblocksection title="my contact section" id="pg">
               <apex:inputField value="{!c.lastname}" />
               <apex:inputField value="{!c.AssistantName}" />
                <apex:inputField value="{!c.Birthdate}" />
                <apex:inputField value="{!c.Email}" />
                <apex:inputField value="{!c.MobilePhone}" />
           </apex:pageblocksection>
           <apex:pageBlockButtons >
               <apex:commandButton id="saveButtons" action="{!save}" value="Save" reRender=""/>
               
           </apex:pageBlockButtons>
           <apex:pageBlockTable value="{!samepage}" var="c">
               
               <apex:column headerValue="Lastname">
          <apex:outputField value="{!c.Lastname}"/>
          </apex:column> 
               
          <apex:column headerValue="AssistantName">
          <apex:outputField value="{!c.AssistantName}"/>
          </apex:column> 
               
          <apex:column headerValue="Birthdate">
          <apex:outputField value="{!c.Birthdate}"/>
          </apex:column>
          
          <apex:column headerValue="Email">
          <apex:outputField value="{!c.Email}"/>
          </apex:column>
               
           <apex:column headerValue="MobilePhone">
          <apex:outputField value="{!c.MobilePhone}"/>
          </apex:column>
          </apex:pageBlockTable>
              
        
        </apex:pageBlock>
        
    
    </apex:form>
</apex:page>









 public with sharing class contact_output{

    public Contact c { get; set; }
    public List<Contact> samepage { get; set; }
    
    public contact_output(){
       c=new Contact();
    }

    public PageReference save() {
       insert c;  
      samepage= [select id,Lastname,AssistantName,Birthdate,Email,MobilePhone from Contact where id=:c.id];
        return null;
    }

 }
 
I found this link https://developer.salesforce.com/blogs/engineering/2014/04/building-content-rich-visualforce-pages-with-salesforce-crm-content.html to download multiple files as .zip from ContentVersion.

Can we use /sfc/servlet.shepherd/version/download/ to download multiple files?
Since this is not documented in any of the salesforce docs.