Invalid Report Source Error in Crystal Report Viewer 
Author Message
 Invalid Report Source Error in Crystal Report Viewer

Hi there ,

well can any body please let me know what wrong i m doing in the below
code ..

when i try to Launch the Report

i m using VB.Net and SQL-Server 2000 as database

the below code use to work fine with Msaccess database

thanks in advance..



    'Crystal Report Variables
    Dim crReport1 As crReport1

    Dim crTableLogonInfo As TableLogOnInfo
    Dim crConnectionInfo As ConnectionInfo
    Dim crTable As Table

Private sub Load Report

    crReport1= New crReport1()

    SetDatabaseLocation(CType(crReport1, ReportDocument))

    crReport1.PrintOptions.PaperOrientation = PaperOrientation.Portrait

    crViewer.ReportSource = crReport1

end sub

Public Sub SetDatabaseLocation(ByRef crReport As ReportDocument)

        Dim crTableLogonInfo As New TableLogOnInfo()
        Dim crConnectionInfo As New ConnectionInfo()
        Dim crTable As Table
        Dim crSections As Sections
        Dim crSection As Section
        Dim crReportObjects As ReportObjects
        Dim crReportObject As ReportObject
        Dim crSubreportObject As SubreportObject
        Dim crSubreportDocument As ReportDocument

        crConnectionInfo.DatabaseName = "NorthWind"
        crConnectionInfo.ServerName = "Local"
        crConnectionInfo.UserID = "sa"
        crConnectionInfo.Password = ""

        crTableLogonInfo.ConnectionInfo = crConnectionInfo

        With crReport
            For Each crTable In crReport.Database.Tables

            For Each crSection In .ReportDefinition.Sections
                crReportObjects = crSection.ReportObjects

                For Each crReportObject In crReportObjects
                    If crReportObject.Kind =
ReportObjectKind.SubreportObject Then
                        crSubreportObject = CType(crReportObject,
                        crSubreportDocument =
                        For Each crTable In
                    End If
        End With

        crTableLogonInfo = Nothing
        crConnectionInfo = Nothing
        crTable = Nothing
        crSections = Nothing
        crSection = Nothing
        crReportObjects = Nothing
        crReportObject = Nothing
        crSubreportObject = Nothing
        crSubreportDocument = Nothing

    End Sub

Sat, 30 Jul 2005 23:02:37 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Crystal Report, Invalid report source

2. Passing Parameters from C# to Crystal Report / Crystal Report Viewer

3. crystal reports v6.0 - browser smart viewer error

4. File I/O error in Crystal Reports Viewer

5. Cannot find KeycodeV2.dll, or invalid keycode error at Crystal Reports

6. Cannot find KeycodeV2.dll, or invalid keycode error at Crystal Reports

7. Invalid Export Options error when exporting a crystal report

8. Crystal 9 and the Crystal report viewer OCX.

9. Printing Crystal Reports without Crystal Control ActiveX or Crystal Reports API call

10. VB4 and Crystal Reports - report error 20000 HELP!!

11. 32bit Crystal Reports error reporting links in 3 table database

12. Got error while viewing report using crystal report


Powered by phpBB® Forum Software