0
votes

I have developed a windows application on vb.net 2008 and deployed it on client machine my crystal reports are configured through DSN to server everything is going fine om my development machine but on client machine producing is "Load Report failed" . I have added Reports folders and all RPT files in that folder in installation package through file system.

Dim path As String
path = Application.StartupPath.Substring(0, Application.StartupPath.Length - 10)
Dim fullpath As String = path & "\Reports\slip.rpt "
cryRpt.Load(fullpath) 
1

1 Answers

0
votes

Is the Database name different on the client machine? If so you might need to swap out the tablenames (which also contain the database name) in code so they don't contain your database name:

    Dim logOnInfo As New TableLogOnInfo
    With logOnInfo.ConnectionInfo
        .ServerName = myConString.ServerName
        .DatabaseName = myConString.DatabaseName
        .UserID = myConString.UserName
        .Password = myConString.Password
    End With

    ' Loop through every table in the report.
    For Each Table As Table In cReport.Database.Tables

        ' Apply the new connecion information
        Table.ApplyLogOnInfo(logOnInfo)

        ' Repoint each table to the new database (by cutting the old database name off the front)
        Table.Location = myTable.Location.Substring(Table.Location.LastIndexOf(".") + 1)
    Next