asp.net , c# converting crystal report to pdf not working
-
i have given the following code to get pdf file from crystal report but at last line browser is not moving forwars its just showing process ... can any one help in this regard SqlConnection myConnection = new SqlConnection(); myConnection.ConnectionString = "Data Source=raj;User ID=sa;PWD=****;Initial Catalog=****"; SqlCommand MyCommand = new SqlCommand(); MyCommand.Connection = myConnection; MyCommand.CommandText = "Select top 5 * from items"; MyCommand.CommandType = CommandType.Text; SqlDataAdapter MyDA = new SqlDataAdapter(); MyDA.SelectCommand = MyCommand; DataSet myDS = new DataSet(); MyDA.Fill(myDS, "items"); testrpt oRpt = new testrpt(); oRpt.SetDataSource(myDS); ReportDocument doc = new ReportDocument(); string fileName = Server.MapPath("testrpt.rpt"); TableLogOnInfo LogInfo = new TableLogOnInfo(); LogInfo.ConnectionInfo.ServerName = "raj"; LogInfo.ConnectionInfo.UserID = "sa"; LogInfo.ConnectionInfo.Password = "sa!2009"; LogInfo.ConnectionInfo.DatabaseName = "fssads"; CrystalDecisions.CrystalReports.Engine.ReportDocument O_Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument(); O_Report.Load(Server.MapPath("testrpt.rpt")); O_Report.Database.Tables[0].ApplyLogOnInfo(LogInfo); O_Report.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "rptpdf");