rendering to excel

Posts   
 
    
mafti
User
Posts: 38
Joined: 27-Oct-2004
# Posted on: 23-Dec-2004 08:58:42   

Hi,

i know how to render one datagrid to excel. i know how to render 2 datagrids to excel in one sheet

these are a piece of cake.

but how do i render 2 datagrids to excel in 2 sheets????

Response.Clear() Response.Buffer = True Response.ContentType = "application/vnd.ms-excel" Response.AddHeader("Content-Disposition", "inline;filename=FooBar.xls") Response.Charset = "" Me.EnableViewState = False Dim oStringWriter As System.IO.StringWriter = New System.IO.StringWriter Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(oStringWriter) SomeGrid.RenderControl(oHtmlTextWriter) 'what do i do here 'perhaps oHtmlTextWriter("add something nifty here so it'll get 2 sheets?") SomeOtherGrid.RenderControl(oHtmlTextWriter) Response.Write(oStringWriter.ToString()) Response.End()