-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: dnetjockey
Message 7 in Discussion



hi guru,

 open an new webform and have only datagrid in that set autogenerate to true 
and populate the datagrid with the data and add the following code in it. it is 
in vb.net u can extend it to c# also.

 

happy coding

'generate an excel sheet

Response.Clear()

Response.Buffer = True

Response.ContentType = "Application/.xls"

Response.Charset = ""

Me.EnableViewState = False

Dim oStringWriter As System.IO.StringWriter

oStringWriter = New System.IO.StringWriter()

Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter

oHtmlTextWriter = New System.Web.UI.HtmlTextWriter(oStringWriter)

DataGrid1.RenderControl(oHtmlTextWriter)

Response.Write("Monthly Report :October-2004)" & "<br>")

Response.Write(oStringWriter.ToString())

HttpContext.Current.Response.AppendHeader("Content-disposition", 
"attachment;filename")

HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"

Gururaaj <[EMAIL PROTECTED]> wrote:





New Message on BDOTNET



DataSet to Excel





Reply





 
Reply to Sender   Recommend 
Message 1 in Discussion 





From: Gururaaj 



I would like to export a table in a DataSet to Excel spreadsheet.
 
Can anybody guide me on how to do this?
 
Thanks,
Gururaj
View other groups in this category. 



                 Too much spam in your inbox? Yahoo! Mail gives you the best 
spam protection for FREE!
http://in.mail.yahoo.com

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to