Load Report Failed error

jotae

Member
Joined
Jan 8, 2008
Messages
5
Programming Experience
1-3
I have finished a little APP for a special video catalogue

Developer Computer:
OS: Windows XP SP2
Crystal: 2008 Developer

Client Computer (Idem)

The reports was generated in Crystal directly not in VSN 2005

In the Developer Computer no problem but in the Client Computer I receive the error:

Load Report Failed

The Code:

VB.NET:
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class Reporte
 Private Sub CRView_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles CRView.Load
  'Private Sub Reportes_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
  Try
   Dim document As ReportDocument
   document = New ReportDocument
   document.Load(Application.StartupPath & "\" & vReporte)  'vReporte previous defined
   CRView.ReportSource = document
   CRView.Refresh()
  Catch ex As Exception
   MessageBox.Show(ex.Message)
  End Try
 End Sub
End Class

The Client Computer have installed the Crystal 2008 Runtime.

Please, what´s wrong?

Thanks in advanced...
 
replay

VB.NET:
Dim strConnection As String = ("Data source=servername; Initial catalog=dbname; Integrated security=true")
                    Dim Connection As New SqlConnection(strConnection)
                    Dim strSQL As String = "select * from tblname'"
                    Dim DA As New SqlDataAdapter(strSQL, Connection)
                    Dim DS1 As New DataSet
                    Dim strReportName As String
                    DA.Fill(DS1)
                    Dim strReportPath As String = "C:\Program Files\Litho\Reports.rpt"
                    '        Check file exists
                    If Not IO.File.Exists(strReportPath) Then
                        Throw (New Exception("Unable to locate report file:" & vbCrLf & strReportPath))
                    End If
                    Dim rptDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
                    rptDocument.Load(strReportPath)
                    rptDocument.SetDataSource(DS1.Tables(0))
                    rptviewer.ShowRefreshButton = False
                    rptviewer.ShowCloseButton = False
                    rptviewer.ShowGroupTreeButton = False
                    rptviewer.ReportSource = rptDocument
                    rptviewer.Visible = False
                    rptviewer.PrintReport()

Plz try this. if it work means send reply for me.
 
Last edited by a moderator:
Ok

that means the reports path is not correct or rports in not present on your system.please chech that one.
then the procedure of the crystal reports for that code.
1.open and select server and select tblname and open the reports and save the reports.
2.then plz enter correct path of crystal reports.

don't mistaken me. you are well in crystatl reports. bur=t this is my way of process.so plz try this way. it will work correctly
 
Back
Top