Unable to run a report from client PC...
-
Respected Sir, I have developed a web application in VS 2005. It has a report created in Crystal report. It works fine on my development machine or even on my web server (while the project is running locally on web server itself). But i am not able to get that repport after deploying the project on my server and accessing from client. i am using the URL like http://PublicIP/ProjectName/frmLogin.aspx It shows me the error "Load Report Failed." I have googled a lot but can not get any idea.... My code is------ Dim rptRefForm As RptShowRefForm Dim ref_no, year As Integer Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then ShowReport() End If End Sub Private Sub ShowReport() Try conn = New SqlConnection(constr) cmd = New SqlCommand("spr_getReport", conn) cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.Add(New SqlParameter("@ref_no_toShow", Glb_RefNo)) cmd.Parameters.Add(New SqlParameter("@FinYear", Glb_FinYearFrom)) dadapter = New SqlDataAdapter(cmd) ds = New DataSet dadapter.Fill(ds) rptRefForm = New RptShowRefForm rptRefForm.Refresh() rptRefForm.SetDataSource(ds.Tables(0)) rptRefForm.SetDatabaseLogon("DBUserName", "DBPWD") CrystalReportViewer1.ReportSource = rptRefForm CrystalReportViewer1.DataBind() conn.Close() Catch ex As Exception lblError.Text = ex.Message End Try End Sub And on click of a button i want to export this report in to PDF format... for that i m using... Private Sub btnExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExport.Click Dim oStream As New MemoryStream ' // using System.IO 'this contains the value of the selected export format. ShowReport() oStream = rptRefForm.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat) Response.Clear() Response.Buffer = True Response.ContentType = "application/pdf" Try Response.BinaryWrite(oStream.ToArray()) Response.End() Catch err As Exception Response.Write("< BR >") Response.Write(err.Message.ToString)
-
Respected Sir, I have developed a web application in VS 2005. It has a report created in Crystal report. It works fine on my development machine or even on my web server (while the project is running locally on web server itself). But i am not able to get that repport after deploying the project on my server and accessing from client. i am using the URL like http://PublicIP/ProjectName/frmLogin.aspx It shows me the error "Load Report Failed." I have googled a lot but can not get any idea.... My code is------ Dim rptRefForm As RptShowRefForm Dim ref_no, year As Integer Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then ShowReport() End If End Sub Private Sub ShowReport() Try conn = New SqlConnection(constr) cmd = New SqlCommand("spr_getReport", conn) cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.Add(New SqlParameter("@ref_no_toShow", Glb_RefNo)) cmd.Parameters.Add(New SqlParameter("@FinYear", Glb_FinYearFrom)) dadapter = New SqlDataAdapter(cmd) ds = New DataSet dadapter.Fill(ds) rptRefForm = New RptShowRefForm rptRefForm.Refresh() rptRefForm.SetDataSource(ds.Tables(0)) rptRefForm.SetDatabaseLogon("DBUserName", "DBPWD") CrystalReportViewer1.ReportSource = rptRefForm CrystalReportViewer1.DataBind() conn.Close() Catch ex As Exception lblError.Text = ex.Message End Try End Sub And on click of a button i want to export this report in to PDF format... for that i m using... Private Sub btnExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExport.Click Dim oStream As New MemoryStream ' // using System.IO 'this contains the value of the selected export format. ShowReport() oStream = rptRefForm.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat) Response.Clear() Response.Buffer = True Response.ContentType = "application/pdf" Try Response.BinaryWrite(oStream.ToArray()) Response.End() Catch err As Exception Response.Write("< BR >") Response.Write(err.Message.ToString)
hello Ajay Kumar, I had the same error.. try installing the Crystal Reports for .NET Framework 2.0 it works for me now http://msdn2.microsoft.com/en-us/library/ms225293(VS.80).aspx[^] Greetings, Marco van der Linden :)
-
hello Ajay Kumar, I had the same error.. try installing the Crystal Reports for .NET Framework 2.0 it works for me now http://msdn2.microsoft.com/en-us/library/ms225293(VS.80).aspx[^] Greetings, Marco van der Linden :)
Hello Sir I have already installed Crystal reports for .Net Framework 2.0. But still the same error.. Infact i have installed VS2005 on my web server. But Of no use.... Suggest something Plz...
-
hello Ajay Kumar, I had the same error.. try installing the Crystal Reports for .NET Framework 2.0 it works for me now http://msdn2.microsoft.com/en-us/library/ms225293(VS.80).aspx[^] Greetings, Marco van der Linden :)
Sir I m giving the stacktrace and message of my exception object which generates when i m trying to access my web site from the public IP.. StackTrace:---- at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) at CrystalDecisions.CrystalReports.Engine.ReportClass.Load(String reportName, OpenReportMethod openMethod, Int16 parentJob) at CrystalDecisions.CrystalReports.Engine.ReportDocument.EnsureLoadReport() at CrystalDecisions.CrystalReports.Engine.ReportDocument.get_FormatEngine() at CrystalDecisions.CrystalReports.Engine.ReportDocument.Refresh() at Mktg_Artwork.frmDisplayRpt.ShowReport() in C:\Inetpub\wwwroot\Mktg-Artwork\frmDisplayRpt.aspx.vb:line Message:--- Load Report Failed. However i have already installed crystal reports for .net framework2.0 on web server Infact I have installed VS2005 on my web server. Still facing the above problem.. Please Sir,help me out.... Ajay Kumar