|
-
Jan 3rd, 2003, 04:21 PM
#7
Thread Starter
Member
We're so close...
So far this is what I've got:
Private Sub cmdExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExcel.Click
Try
Dim FileName As String = "PendingSteps.xls"
Dim FileAndPath As String = "C:\My Documents\" & FileName
Response.Clear()
Response.ContentType = "application/vnd.ms-excel"
Response.AppendHeader("Content-Disposition", "attachment; filename=" & FileName)
Response.Flush()
Response.WriteFile(FileAndPath)
Catch ex As OleDb.OleDbException
lblError.Text = "There has been an error. Please advise MIS of this error message: " & ex.Message
End Try
End Sub
It is finally making an Excel worksheet, but it's 0 bytes (meaning it's not sending the datagrid, just a blank file) How would I make sure the datagrid is going too?
Thanks again for all the help Ken...
Ooogs
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|