![]() |
|
|
|
#1 |
|
Hi,
I need to Save my Excel File which I created from a DataGrid to my Hard Drive(C:\) using the C#.NET codes. It can be saved by the dialog box but I don't need that....I need the prior.. SomeOne Please Help Me.... Thanks Tapas Mahata Code Sample : public void ExportToSpreadsheet(DataGrid dg, string name) { Response.ClearContent(); Response.AddHeader("content-disposition", "attachment; filename=" + name); Response.ContentType = "application/excel"; System.IO.StringWriter sw = new System.IO.StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); dg.RenderControl(htw); Response.Write(sw.ToString()); Response.End(); } tapasmahata |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Loading 24,000 rows into C# .net Datagrid | Kagu | Software | 0 | 03-10-2009 06:51 PM |
| ASP.NET VB Using ItemDataBound to create textbox in datagrid rows. | smi59550 | General Help Related Topics | 0 | 01-18-2008 07:42 PM |
| How to run a Excel Macro from the Java application? | Kiranu | General Help Related Topics | 0 | 09-12-2007 02:11 PM |
| Uploading Excel file into sql table | shalim | Software | 1 | 10-31-2006 08:57 AM |
| Disable ASP Button in a Datagrid | ChrisClayko | General Help Related Topics | 0 | 08-02-2006 03:08 AM |