This is a migrated thread and some comments may be shown as answers.

How to open an Excel file programmatically?

7 Answers 2275 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 11 May 2018, 01:29 PM

I have the Kendo Spreadsheet installed and I can open an Excel file in it using the Open button at the left of the menu toolbar.  However, I want to be able to open an Excel file automatically when my ASP.NET MVC page loads.  The reason is because there are many large spreadsheets in the file and it swamps the browser when it opens.  I want to use Open XML to extract one sheet from the file, save it on the server, then open that one file in the Spreadsheet control.  I can do the Open XML part if someone here can tell me how to automatically open the file in client-side jQuery code, I guess.

Steve

 

7 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 15 May 2018, 10:17 AM
Hello Steve,

I have just replied to your other ticket, where this question was posted. For transparency - the approach that we suggest is using the Load method of the Spreadsheet as demonstrated in the following documentation article:

https://docs.telerik.com/aspnet-mvc/helpers/spreadsheet/spreadsheet-processing#load-data-from-external-file

Hope this would help.

Regards,
Nencho
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Steve
Top achievements
Rank 1
answered on 15 May 2018, 01:53 PM

Nencho

Thanks, That worked.  I will mark the ticket closed but I have one more question.  You can answer here or there:

Does that do the same thing (initialize the spreadsheet) as the line "$("#spreadsheet").kendoSpreadsheet();"?
Thank you very much, Steve 
 
@(Html.Kendo().Spreadsheet()
    .Name("spreadsheet")
)

0
Nencho
Telerik team
answered on 17 May 2018, 01:53 PM
Hello Steve,

Yes, the demonstrated code-snippet is the equivalent for implementation in Razor syntax.

Regards,
Nencho
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
yogesh kumar
Top achievements
Rank 1
answered on 16 Nov 2018, 12:37 PM
Can you please tell how to open an excel file automatically in angular js
0
Nencho
Telerik team
answered on 20 Nov 2018, 10:35 AM
Hello Yogesh,

You should use the very same approach in AngularJS scenario - you have to prepare the excel file at your backend and have it accessible with an ajax call (using $http.get). Once requested, the backend should return the file and you have to load it with method of the API of the Spreadsheet:

Exemplary implementation could be found below:

https://dojo.telerik.com/@nenchef/IRABixoh

Hope this would help.

Regards,
Nencho
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Asad
Top achievements
Rank 1
Veteran
answered on 08 Jun 2020, 02:05 PM

Hi Nencho,

How to open excel file automatic on load page in asp.net core. 

 

0
Nencho
Telerik team
answered on 10 Jun 2020, 09:15 AM

Hello, Asad,

You can use the approach that was previously suggested but executed at $(document).ready(function(...)) stage.

Regards,
Nencho
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Spreadsheet
Asked by
Steve
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Steve
Top achievements
Rank 1
yogesh kumar
Top achievements
Rank 1
Asad
Top achievements
Rank 1
Veteran
Share this question
or