G Guest Jun 1, 2004 #1 hiye, i've got some data which i've query from the db and how do i get it into ms excel any body done this before?
hiye, i've got some data which i've query from the db and how do i get it into ms excel any body done this before?
A avnrao Jun 1, 2004 #2 follow these steps.. get data into dataset/datareader bind it to datagrid and render the control. DataSet dsData = (DataSet) Session[PRISMWebConstants.REPORT_DATASET_KEY]; DataView dvData = new DataView(dsData.Tables[0]); dvData.Sort = "Column ASC"; DataGrid dgTemp = new DataGrid(); dgTemp.DataSource = dvData; dgTemp.DataBind(); StringWriter swData = new StringWriter(); HtmlTextWriter htmlTWData = new HtmlTextWriter(swData); dgTemp.RenderControl(htmlTWData); Response.Write(swData.ToString()); Response.End(); Av.
follow these steps.. get data into dataset/datareader bind it to datagrid and render the control. DataSet dsData = (DataSet) Session[PRISMWebConstants.REPORT_DATASET_KEY]; DataView dvData = new DataView(dsData.Tables[0]); dvData.Sort = "Column ASC"; DataGrid dgTemp = new DataGrid(); dgTemp.DataSource = dvData; dgTemp.DataBind(); StringWriter swData = new StringWriter(); HtmlTextWriter htmlTWData = new HtmlTextWriter(swData); dgTemp.RenderControl(htmlTWData); Response.Write(swData.ToString()); Response.End(); Av.
S Steve C. Orr [MVP, MCSD] Jun 1, 2004 #4 This article explains in detail: http://www.aspnetpro.com/NewsletterArticle/2003/09/asp200309so_l/asp200309so_l.asp
This article explains in detail: http://www.aspnetpro.com/NewsletterArticle/2003/09/asp200309so_l/asp200309so_l.asp