We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

exportPivotGrid

Can someone explain the first parameter for the exportPivotGrid function for me please

1 Reply

SP Sastha Prathap Selvamoorthy Syncfusion Team December 2, 2016 12:28 PM UTC

Hi Damion,   
   
Thank you for looking Syncfusion products.   
   
The first parameter of the ExportPivotGrid is an “URL” link (link is either online hosted link or local hosted service file) which contains the code to export the PivotGrid. Please find the sample to export PivotGrid using the “ExportPivotGrid”.   
 
Note: In the Exporting sample, we have provided the export link as window.baseurl + "api/PivotGrid/Olap/ExcelExport” “. The “window.baseurl”  indicates the source link hosted to IIS server from the ejservice path.   
 
So, you can provide your local service file or online link to export the PivotGrid. Please refer to the below sample code example.   
 
Local Link:   
if (exportOption == "excel")   
    pGridObj.exportPivotGrid(../api/PivotGrid/Olap/ExcelExport""fileName");   
   
Online Link:   
if (exportOption == "excel")   
    pGridObj.exportPivotGrid(http://js.syncfusion.com/demos/ejservices/api/PivotGrid/Olap/ExcelExport""fileName");   
  
Code contained in “../api/PivotGrid/Olap/ExcelExport” below:   
   
        [AcceptVerbs("Post")]   
        public void ExcelExport()   
        {   
            PivotGridExcelExport pGrid = new PivotGridExcelExport();   
            string args = HttpContext.Current.Request.Form.GetValues(0)[0];   
            pGrid.ExportToExcel(string.Empty, args, HttpContext.Current.Response);   
        }   
  
Regards,   
Sastha Prathap S.  


Loader.
Up arrow icon