I am new to .net development and I am working on some reports where the user needs to have web printing option. Since the report requires column headers in all the pages, I have decided to use crystal reports instead of using window.print(). What I learned is to do web printing using crystal reports, I need to export it to pdf file and stream it to the user. Herewith I am providing the code I am using
'Dim oStream As New System.IO.MemoryStream
oRpt.SetDataSource(dt)
myExportFile = "c:\temp\" & Session.SessionID.ToString & ".pdf"
'Response.BinaryWrite(oXMLHttp.ResponseBody)
Response.WriteFile(myExportFile)
'Response.End()
'Response.WriteFile(myExportFile)
'Response.Redirect(myExportFile)
Response.Flush()
Response.Close()
System.IO.File.Delete(myExportFile)
The code works fine in my local pc, but it gives File download window showing Open, Save, Cancel option when I deploy it into a web server. I tried to launch my website using Firefox or Netscape Navigator, the website works fine. I am not sure what I am missing in my web server to make the IE work without showing the File Download window.
Your help will be greatly appreciated if anyone throw some light in this problem
'Dim oStream As New System.IO.MemoryStream
oRpt.SetDataSource(dt)
myExportFile = "c:\temp\" & Session.SessionID.ToString & ".pdf"
'Response.BinaryWrite(oXMLHttp.ResponseBody)
Response.WriteFile(myExportFile)
'Response.End()
'Response.WriteFile(myExportFile)
'Response.Redirect(myExportFile)
Response.Flush()
Response.Close()
System.IO.File.Delete(myExportFile)
The code works fine in my local pc, but it gives File download window showing Open, Save, Cancel option when I deploy it into a web server. I tried to launch my website using Firefox or Netscape Navigator, the website works fine. I am not sure what I am missing in my web server to make the IE work without showing the File Download window.
Your help will be greatly appreciated if anyone throw some light in this problem