How to open an Excel file programmatically?

8 posts, 0 answers
  1. Steve
    Steve avatar
    3 posts
    Member since:
    May 2018

    Posted 11 May 2018 Link to this post

    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

     

  2. Nencho
    Admin
    Nencho avatar
    1890 posts

    Posted 15 May 2018 Link to this post

    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.
  3. Steve
    Steve avatar
    3 posts
    Member since:
    May 2018

    Posted 15 May 2018 in reply to Nencho Link to this post

    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")
    )

  4. Nencho
    Admin
    Nencho avatar
    1890 posts

    Posted 17 May 2018 Link to this post

    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.
  5. yogesh kumar
    yogesh kumar avatar
    2 posts
    Member since:
    Nov 2018

    Posted 16 Nov 2018 Link to this post

    Can you please tell how to open an excel file automatically in angular js
  6. Nencho
    Admin
    Nencho avatar
    1890 posts

    Posted 20 Nov 2018 Link to this post

    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 fromJSON 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.
  7. Asad
    Asad avatar
    16 posts
    Member since:
    Nov 2019

    Posted 08 Jun 2020 Link to this post

    Hi Nencho,

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

     

  8. Nencho
    Admin
    Nencho avatar
    1890 posts

    Posted 10 Jun 2020 Link to this post

    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.
Back to Top