Home All Groups Group Topic Archive Search About
Author
9 Dec 2005 8:59 AM
monalisa
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)

Author
9 Dec 2005 9:55 AM
Patrick.O.Ige
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)
>
>
>
Author
9 Dec 2005 10:15 AM
Mark Rae
"Patrick.O.Ige" <naijaco***@toughguy.net> wrote in message
news:e8mmtaK$FHA.3908@TK2MSFTNGP10.phx.gbl...

> Monalisa go through
> http://www.dotnetjohn.com/articles.aspx?articleid=78

This works really well, and there are loads of similar examples all over the
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...

AddThis Social Bookmark Button