+ Start a Discussion
Akash Garg 2Akash Garg 2 

Export data to network path directly

I have created a custom button on opportunity page to export data to excel of Opportunity Header and its Related List.
It download to local system when i click button.
How can I download it on a network path directly or FTP path??
VF Page:-
<apex:page Standardcontroller="Opportunity" extensions="Controller_QuotePage" contenttype="application/vnd.ms-excel#test.xls">
<apex:pageBlock >
<apex:pageBlockTable value="{!qt}" var="cs">
<apex:column value="{!cs.ID}" />
<apex:column value="{!cs.Name}" />
<apex:column value="{!Opportunity.Sub_Region__c}" />
<apex:column value="{!Opportunity.Business_Type__c}" />
<apex:column value="{!Opportunity.Due_date_of_Tender_Submission__c}" />
<apex:column value="{!Opportunity.Name}" />--> 
<apex:pageBlockTable value="{!LineItems}" var="cs1">
<apex:column value="{!cs1.ID}" />
<apex:column value="{!cs1.Name}" />

Apex controller: -
public with sharing class Controller_QuotePage {
   public Opportunity qt {get; set;}
   public List<Opportunity_Product__c> theLineItems {get; set;}
   public Controller_QuotePage(ApexPages.StandardController controller) 
       Id quoteID = ((Opportunity) controller.getRecord()).Id;
    public List<Opportunity_Product__c> getLineItems(){
         return theLineItems;
   private void loadQuote(String quoteId) {
        this.qt = [Select Id, Name       
                   FROM Opportunity where    
   private void loadQuoteLineItems(String quoteId) {
       this.theLineItems = [SELECT Id, Name                          
                             FROM Opportunity_Product__c WHERE Opportunity__c =: