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.
Unfortunately, activation email could not send to your email. Please try again.

View Excel in Web browser

Thread ID:

Created:

Updated:

Platform:

Replies:

125057 Jul 18,2016 08:30 AM Jul 19,2016 07:41 AM ASP.NET MVC 1
loading
Tags: Spreadsheet
Rames
Asked On July 18, 2016 08:30 AM

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

Silambarasan I [Syncfusion]
Replied On July 19, 2016 07:41 AM

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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;