F
Frank Bishop
I am having problems downloading an Excel file after I export it with
another procedure. When I look at the file after export, it looks fine,
but when I use the sub below, it rearranges all the data in the excel
file to an unreadable glob. Help appreciated.
Thanks,
Frank
<code>
Sub DisplayDownloadDialog()
Dim ExportPath As String
ExportPath = Request.PhysicalApplicationPath + "Exported\"
Dim strPhysicalPath As String
Dim objFileInfo As System.IO.FileInfo
strPhysicalPath = ExportPath + Session.SessionID.ToString +
".xls"
objFileInfo = New System.IO.FileInfo(strPhysicalPath)
'Add Headers to enable dialog display
Response.AddHeader("Content-Disposition", "attachment;
filename=" & _
objFileInfo.Name)
Response.AddHeader("Content-Length",
objFileInfo.Length.ToString())
Response.ContentType = "application/octet-stream"
End Sub
</code>
another procedure. When I look at the file after export, it looks fine,
but when I use the sub below, it rearranges all the data in the excel
file to an unreadable glob. Help appreciated.
Thanks,
Frank
<code>
Sub DisplayDownloadDialog()
Dim ExportPath As String
ExportPath = Request.PhysicalApplicationPath + "Exported\"
Dim strPhysicalPath As String
Dim objFileInfo As System.IO.FileInfo
strPhysicalPath = ExportPath + Session.SessionID.ToString +
".xls"
objFileInfo = New System.IO.FileInfo(strPhysicalPath)
'Add Headers to enable dialog display
Response.AddHeader("Content-Disposition", "attachment;
filename=" & _
objFileInfo.Name)
Response.AddHeader("Content-Length",
objFileInfo.Length.ToString())
Response.ContentType = "application/octet-stream"
End Sub
</code>