I am trying using following code to open crystal report in PDF but it does not work. A window opens and then disappear. What are the causes?
CrystalReportSource1.Report.FileName = Server.MapPath("Report1.rpt")
CrystalReportSource1.ReportDocument.SetDatabaseLogon("myuser", "mypassword")
CrystalReportViewer1.Visible = False
CrystalReportSource1.ReportDocument.VerifyDatabase()
Response.Buffer = True
Response.ClearContent()
Response.ClearHeaders()
CrystalReportSource1.ReportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, True, "Report1")