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

Export to Excel (Open File insted of Save)

28 Answers 1102 Views
GridView
This is a migrated thread and some comments may be shown as answers.
bradley baker
Top achievements
Rank 1
bradley baker asked on 22 Jan 2010, 08:43 PM
Is there anyway when exporting to have the file open in excel insted of prompting to save?

28 Answers, 1 is accepted

Sort by
0
Accepted
Martin Vasilev
Telerik team
answered on 27 Jan 2010, 01:34 PM
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.
0
Ofer
Top achievements
Rank 1
answered on 12 Jan 2012, 05:02 PM
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.
0
Ivan Petrov
Telerik team
answered on 17 Jan 2012, 10:27 AM
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).

0
Ofer
Top achievements
Rank 1
answered on 19 Jan 2012, 10:03 AM
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
0
Ofer
Top achievements
Rank 1
answered on 23 Jan 2012, 10:10 AM
Hi'
IS THERE ANY BODY GOING TO LISTEN TO MY QUESTION?
Ofer. 
0
Ivan Petrov
Telerik team
answered on 24 Jan 2012, 09:39 AM
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).

0
Ofer
Top achievements
Rank 1
answered on 24 Jan 2012, 10:10 AM
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.
0
Ivan Petrov
Telerik team
answered on 26 Jan 2012, 04:53 PM
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).

0
N Mackay
Top achievements
Rank 1
answered on 10 Apr 2012, 11:48 AM
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.




0
Julian Benkov
Telerik team
answered on 13 Apr 2012, 10:30 AM
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 >>
0
Shahriar
Top achievements
Rank 1
answered on 25 Apr 2012, 07:53 PM
the feature should be standard function of the grid!!!

I am really superise from your design team for leaving out such a essential function.
0
Julian Benkov
Telerik team
answered on 01 May 2012, 06:30 AM
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 >>
0
Guy
Top achievements
Rank 1
answered on 29 May 2014, 02:34 PM
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
0
Stefan
Telerik team
answered on 29 May 2014, 03:00 PM
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.
 
0
Fro
Top achievements
Rank 1
answered on 26 Feb 2016, 08:24 PM

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. 

0
Stefan
Telerik team
answered on 29 Feb 2016, 08:01 AM
Hi Fro,

Yes, this feature is already implemented. On the case 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
0
Fro
Top achievements
Rank 1
answered on 29 Feb 2016, 02:53 PM

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

0
Stefan
Telerik team
answered on 01 Mar 2016, 11:29 AM
Hi Fro,

This thread is in the RadGridView forum section, 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
0
Ofer
Top achievements
Rank 1
answered on 19 Sep 2016, 01:37 PM

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

0
Hristo
Telerik team
answered on 20 Sep 2016, 04:55 PM
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.
0
Lavanya
Top achievements
Rank 1
answered on 30 Apr 2018, 07:16 AM

Hi Team,

#Kendo Grid

I am looking for similar requirement. In My case open excel functionality is required for Kendo Grid export.

I am using Kendo Grid in my application and when I am doing Export to Excel, Open excel option is not there only Save and Cancel are available.checked in both IE11 and Chrome.

As per my observation, Open file option is not coming for Excel,PDF,CSV files.

Any reply on this post is highly appreciated as this is critical requirement for me.

 

0
Hristo
Telerik team
answered on 30 Apr 2018, 09:28 AM
Hello Lavanya,

Please note that the thread discusses the RadGridView control for WinForms. Since you are using the Kendo grid please post your question in the proper forum: https://www.telerik.com/forums/kendo-ui. This way your question will reach the people who can help you best.

Regards,
Hristo
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
Lavanya
Top achievements
Rank 1
answered on 30 Apr 2018, 10:04 AM

Hi Hristo,

Thanks for the fast response. I have tried in the forum link given by you. Its only for users with active subscription.

I cant get the subscription on the immediate basis. Is there any other way round to get the clarification on my query.

Please help!!!

 

0
Hristo
Telerik team
answered on 30 Apr 2018, 10:39 AM
Hello Lavanya,

You can also post your question in the "Kendo UI" category in StackOverflow: https://stackoverflow.com/search?q=kendoui.

Regards,
Hristo
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
Lavanya
Top achievements
Rank 1
answered on 30 Apr 2018, 12:20 PM

Hi Hristo,

Thank you so much for your guidance. Have posted the query in relevant forum.

Thanks once again.

Lavanya.

 

0
Ron
Top achievements
Rank 1
answered on 14 Aug 2018, 01:42 AM
You can try ZetExcel.com If you need Excel generation functionality for your .net application.
0
Stefan
Top achievements
Rank 1
answered on 30 Mar 2021, 12:38 PM

Hi,

meanwhile I hit the same "issue" and tried to get Excel started directly with the data.
No idea Excel can display the generated data from the Grid without having a real file (xlsx) behind.

Workaround? Write a temporary file and open it ..

But Windows has not the option to unlink files (as in Unix) just after creation.

//Stefan

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 30 Mar 2021, 01:11 PM
Hello, Stefan, 

RadGridView offers several ways of exporting its content to Excel format. I would recommend using the GridViewSpreadExport utilizes our RadSpreadProcessing library to export the content of RadGridView to xlsx, csv, pdf and txt formats: 
https://docs.telerik.com/devtools/winforms/controls/gridview/exporting-data/spread-export 

However, it is necessary to export the content to a file (.xlsx) and then open this file in Excel. Usually, Process.Start(fileName) will do the job. If you don't need the file later, you are free to delete it from the FileExplorer.

An alternative approach is to use exporting to a memory stream:
https://docs.telerik.com/devtools/winforms/controls/gridview/exporting-data/spread-export#running-export-synchronously-using-a-stream 

Then, it is up to you how you want to process that stream.
 
I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
GridView
Asked by
bradley baker
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Ofer
Top achievements
Rank 1
Ivan Petrov
Telerik team
N Mackay
Top achievements
Rank 1
Julian Benkov
Telerik team
Shahriar
Top achievements
Rank 1
Guy
Top achievements
Rank 1
Stefan
Telerik team
Fro
Top achievements
Rank 1
Hristo
Telerik team
Lavanya
Top achievements
Rank 1
Ron
Top achievements
Rank 1
Stefan
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or