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

View Excel in Web browser

Hi,
Is there any control to view excel in web browser. That Excel must contain the pivot table option.

1 Reply

SI Silambarasan I Syncfusion Team July 19, 2016 11:41 AM UTC

Hi Rames, 
 
Thank you for using Syncfusion products. 
 
Yes. In Spreadsheet control, we can view the MS Excel files [formats - “XLSX, XLS”] in web browsers by using Ribbon ‘FILE’=>‘Open’ menu option or using ‘import()’ client-side method.  We have also provided the support to import the pivot table contained Excel files too.   
 
For your convenience, we have prepared a sample to demonstrate your requirement “Viewing pivot table contain Excel file in MVC Spreadsheet” and the same can be downloaded from the following sample link.  Please refer the following code example to achieve your requirement. 
 
VIEW 
 
@(Html.EJ().Spreadsheet<object>("Spreadsheet") 
.EnablePivotTable(true) 
//... 
.ImportSettings(import => 
{ 
    import.ImportMapper("Home/Import"); 
}) 
.ClientSideEvents(events => events.LoadComplete("onLoadComplete")) 
) 
 
<script type="text/javascript"> 
 
function onLoadComplete(args) { 
    if (!this.isImport) 
        this.import({ url: "Sample_PivotTableData.xlsx" }); 
} 
 
</script> 
 
 
CONTROLLER 
 
[AcceptVerbs(HttpVerbs.Post)] 
public ActionResult Import(ImportRequest importRequest) 
{ 
    if (importRequest.File == null) 
        importRequest.Url = Request.Url.ToString().Replace(Request.Url.LocalPath, "") + "/Files/" + importRequest.Url; 
 
    return importRequest.SpreadsheetActions(); 
} 
 
 
 
 
For more information, please refer the below online Spreadsheet pivot sample and API help documentation links. 
 
 
 
Regards, 
Silambarasan I 


Loader.
Up arrow icon