Export to Excel (Open File insted of Save)

21 posts, 1 answers
  1. bradley baker
    bradley baker avatar
    97 posts
    Member since:
    Aug 2009

    Posted 22 Jan 2010 Link to this post

    Is there anyway when exporting to have the file open in excel insted of prompting to save?
  2. Answer
    Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 27 Jan 2010 Link to this post

    Hi bradley baker,

    Thank you for your question. ExportToExcelML class does not support directly opening the result file. However, you can easily implement similar functionality through Process.Start method. Please, consider the following code:

    ExportToExcelML exporter = new ExportToExcelML(this.radGridView1);
    exporter.RunExport(@"C:\Test.xls");
      
    System.Diagnostics.Process.Start(@"C:\Test.xls");

    Do not hesitate to contact me again if you have any other questions.

    Best wishes,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ofer
    Ofer avatar
    19 posts
    Member since:
    Jan 2012

    Posted 12 Jan 2012 Link to this post

    Hi.
    I have the same problem.
    This solution is not good enough.  because you can't open another file if this file is still opened.
    And i don't want to random a file name and save lots of files in the user computer.
    I will be happy to have a solution that take the memory stream of the Radgrid and open it in excel without saving it.
    thanks.
  5. Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 17 Jan 2012 Link to this post

    Hi Ofer,

    Thank you for writing.

    There is no mechanism to overwrite the information in an opened file in Windows. What you can do is close the opened MS Excel and reopen it with the new information. Here is a sample code which demonstrates this:
    Process excel;
     
    private void radButtonExcelML_Click(object sender, EventArgs e)
    {
      Process[] processes = Process.GetProcessesByName("EXCEL");
      if (processes.Length > 0)
      {
        this.excel = processes[0];
      }
     
      if (this.excel != null && !this.excel.HasExited)
      {
        this.excel.CloseMainWindow();
      }
     
      ExportToExcelML exporter = new ExportToExcelML(this.radGridView1);
      string filePath = @"C:\grid.xls";
      if (this.excel != null)
      {
        bool fileReleased = false;
        while (!fileReleased)
        {
          try
          {
            File.Delete(filePath);
            fileReleased = true;
          }
          catch (IOException)
          { }
        }
      }
     
      exporter.RunExport(filePath);
      this.excel = Process.Start(filePath);
    }

    I hope this will help. If you have further questions, I would be glad to assist.

    All the best,
    Ivan Petrov
    the Telerik team

    SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

  6. Ofer
    Ofer avatar
    19 posts
    Member since:
    Jan 2012

    Posted 19 Jan 2012 Link to this post

    Hi Ivan and thanks for this and for the others.
    I fixed the license as you asked. 
      
    well i think you misunderstand  me.
    When we use the ms grid we made our own excel export. what we offer to the user is 2 things.
    1. Save to excel file.( opening the save dialog ......   Telerik Export to excel is very good for this )
    2. Show grid in excel.( opening immediately  the excel with all the grid rows data..  ).
    In the second case we did not create file but we open for the user an excel sheet with no name ( as well as you open a new excel ). 
    the user can close it without saving or close and save as he wish. i don't want to create any file at all.

    Thanks.

    Ofer
  7. Ofer
    Ofer avatar
    19 posts
    Member since:
    Jan 2012

    Posted 23 Jan 2012 Link to this post

    Hi'
    IS THERE ANY BODY GOING TO LISTEN TO MY QUESTION?
    Ofer. 
  8. Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 24 Jan 2012 Link to this post

    Hi Ofer,

    Thank you for your reply.

    First of all let me explain how our support system works. Forum posts are handled within 72 hours and support tickets are handled according to your license agreement.

    As to your question, currently our export to Excel feature can export only a newly created file. However, your suggestion makes sense and I added it as a feature request to our issue tracking system. You can track its progress by following this link

    If you need further assistance, I would be glad to help.
     
    Kind regards,
    Ivan Petrov
    the Telerik team

    SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

  9. Ofer
    Ofer avatar
    19 posts
    Member since:
    Jan 2012

    Posted 24 Jan 2012 Link to this post

    Hi Ivan,
    OK, Thanks.
    Can you please explain how to save more than one RadGrid in separated sheets at the same new excel file?.  
    Thanks.
  10. Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 26 Jan 2012 Link to this post

    Hello Ofer,

    Thank you for your reply.

    I will try to explain the situation better. Currently, the export to Excel functionality can only export one RadGridView by creating a new Excel file and spreading RadGridView over one or more sheets. There is no way of exporting a RadGridView into an existing file, nor exporting a RadGridView into a separate sheet.

    I hope I have made myself clearer. If you have other questions feel free to write back.

    All the best,
    Ivan Petrov
    the Telerik team

    SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

  11. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 10 Apr 2012 Link to this post

    I'd vote for this as well.

    I'm currently refactoring some screens that use the vanilla winforms gridview to Telerik use RadGridView as we needed the grouping features and other stuff and we purchased the Ultimate edition but mainly it was for WPF.

    This is an oversight as our current usercontrol exports to excel without having to create a file, I guess you have built a bunch of export classes in TelerikData for each type, I've seen other controls like TxTextControl work like this and it's frustrating.

    Essentially now I have to have a temp directory and create a unique filename each time I export as the filename could be open. When I close the screen I have to cleanup the temp files. It's extra work and in this instance RadGridView has added a lot of extra work which is a shame, gets a thumbs down from the dev team but the grid control itself is excellent, just the export is an after thought.




  12. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 13 Apr 2012 Link to this post

    Hi Norman,

    Thank you for your feedback. 

    I will add your vote for this request as well. Once it gathers considerable amount of votes, we will consider the possibilities for implementing such a feature and we will increase its priority amongst the other features/tasks.

    Regards,
    Julian Benkov
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  13. Shahriar
    Shahriar avatar
    1 posts
    Member since:
    Jun 2012

    Posted 25 Apr 2012 Link to this post

    the feature should be standard function of the grid!!!

    I am really superise from your design team for leaving out such a essential function.
  14. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 01 May 2012 Link to this post

    Hi Shahriar,

    Thank you for your feedback. 

    Feel free to add your vote for this feature request at this link:  http://www.telerik.com/support/pits.aspx#/details/Issue=9426.

    Regards,
    Julian Benkov
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  15. Guy
    Guy avatar
    6 posts
    Member since:
    May 2014

    Posted 29 May 2014 in reply to Ivan Petrov Link to this post

    Hi Ivan,

    referring to view excel file without saving :
    "...As to your question, currently our export to Excel feature can export only a newly created file. However, your suggestion makes sense and I added it as a feature request to our issue tracking system. You can track its progress by following this link. "

    Has this solution been added. ?  I cannot find any explanation on this in documentation.
    The link you mentioned here above doesn't work to find the answer.

    I'm now testing  UI for winforms last version  2014 Q1.
    Regards
  16. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 29 May 2014 Link to this post

    Hi Guy,

    This feature is not yet implemented. We are currently working on libraries allowing for handling such documents, and once done, we will improve the controls export functionality as well. Here is a link to the items in our new feedback portal (the previous system was migrated there), where you can track its status: http://feedback.telerik.com/Project/154/Feedback/Details/110527.

    I hope that you find this information useful.

    Regards,
    Stefan
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  17. Fro
    Fro avatar
    2 posts
    Member since:
    Feb 2016

    Posted 26 Feb in reply to Stefan Link to this post

    This question was originally brought up in 2010 and I was wondering if this has been implemented yet. I am referring to the ability to open in excel instead of prompting to save in regards to exporting a grid? 

     

    Thank you. 

  18. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 29 Feb Link to this post

    Hi Fro,

    Yes, this feature is already implemented. On the case page you can see its status is Completed and the release it was introduced: http://feedback.telerik.com/Project/154/Feedback/Details/110527-add-exporttoexcelml-add-possibility-to-export-a-radgridview-to-a-separate-work

    For information how to use this functionality, see the FIleExportMode property here: http://docs.telerik.com/devtools/winforms/gridview/exporting-data/spread-export#properties

    I hope this helps.

    Regards,
    Stefan
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  19. Fro
    Fro avatar
    2 posts
    Member since:
    Feb 2016

    Posted 29 Feb in reply to Stefan Link to this post

    Thanks for your response Stefan but I was not referring to a RadGridView. I was referring to the original question which states: "Is there anyway when exporting to have the file open in excel insted of prompting to save?".

    Currently when you export to excel you only have an option to save the file. There is no option to OPEN or Save. Is there any way to make the export give an option of whether to OPEN in Excel or Save? Open in excel meaning to just open the file without saving it. 

    Thank you. 

     

    -Fro

  20. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 01 Mar Link to this post

    Hi Fro,

    This thread is in the RadGridView forum section, hence it concerns RadGridView related questions. If I understand correctly, you are using RadSpreadProcessing and if so, the proper forums would be: http://www.telerik.com/forums/winforms/spreadprocessing. All forum sections can be found here: http://www.telerik.com/community/forums/winforms.aspx

    Meanwhile, to open a saved file, you can use the Process.Start() API. If this is not what you need, please provide detailed information on what you use and what you need to achieve.

    Regards,
    Stefan
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  21. Ofer
    Ofer avatar
    19 posts
    Member since:
    Jan 2012

    Posted 19 Sep in reply to Ivan Petrov Link to this post

    Hi   
    Is ther any news?
    We realy need a way to export grid to excel.( opening immediately  the excel with all the data in it, with no save nevigator) we dont want to create a file but we want to open an excel sheet with no name ( as well as you open a new excel ). the user can close it without saving or close and save as he wish. i don't want to create any file at all. The user just want to see the grid in excel and to manipulate on it and to close without saving.

    SHORTLY

    NO FILE SAVE NEVIGATOR. DO NOT CREAT A FILE AT ALL. JUST OPEN AN EXCEL SHEET WITH THE DATA GRID.

    IT IS A VERY OLD ASK . PLEASE YOUR HELP.
    Thanks.

    Ofer

  22. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    711 posts

    Posted 20 Sep Link to this post

    Hi Ofer,

    Thank you for writing.

    In our 2016.2.608 release, we introduced support for exporting to a stream instead of writing a file on the system. Please check the following section of this documentation article: Spread Export. Once you have the stream it is up to you to decide how you want to process that stream.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
Back to Top
UI for WinForms is Visual Studio 2017 Ready