|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Datagrid to ExcelI have a Datagrid in ASP.NET , Witch contains employee info and a
Dropdownlist and a calendar control. For performance issue, the user wanted to fill this form in Excel, so I need to export the Data to Excel file to be (offline), and create the drop down list dynamically into the excel. How I can do it , and if there is another suggestion of doing this (infoPath) Monalisa go through
http://www.dotnetjohn.com/articles.aspx?articleid=78 And for formatting tips look at:- http://weblogs.asp.net/datagridgirl/archive/2003/04/14/5631.aspx Patrick Show quote "monalisa" <mona***@hotmail.com> wrote in message news:emcue7J$FHA.1028@TK2MSFTNGP11.phx.gbl... > I have a Datagrid in ASP.NET , Witch contains employee info and a > Dropdownlist and a calendar control. > For performance issue, the user wanted to fill this form in Excel, so I need > to export the Data to Excel file to be (offline), and create the drop down > list dynamically into the excel. > How I can do it , and if there is another suggestion of doing this > (infoPath) > > > "Patrick.O.Ige" <naijaco***@toughguy.net> wrote in message This works really well, and there are loads of similar examples all over the news:e8mmtaK$FHA.3908@TK2MSFTNGP10.phx.gbl... > Monalisa go through > http://www.dotnetjohn.com/articles.aspx?articleid=78 Internet. I'm using the following code: Response.Clear(); Response.ContentType = "application/vnd.ms-excel"; Response.AddHeader("content-disposition", "attachment;filename=c:\\valuations.xls"); Response.Charset = ""; Response.Cache.SetCacheability(HttpCacheability.NoCache); this.EnableViewState = false; System.IO.StringWriter objSW = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter objHTMLTW = new HtmlTextWriter(objSW); tblResults.RenderControl(objHTMLTW); Response.Write(objSW.ToString()); Response.End(); That's fine, except that it displays the data in the same browser window. Is there an easy way to actually open up Excel itself rather than merely displaying the Excel data in the browser? Even opening up another browser window would be better... |
|||||||||||||||||||||||