Results 1 to 6 of 6

Thread: [RESOLVED] Crystal not reading database name

Threaded View

  1. #3

    Thread Starter
    New Member
    Join Date
    Dec 2007
    Location
    Middletown, Ohio
    Posts
    3

    Re: Crystal not reading database name

    It happens to all the reports that I have. I do have access to the database as I can preview the report from within the development environment. I am posting the code to see if that helps solve the issue.
    vb Code:
    1. Imports CrystalDecisions.CrystalReports.Engine
    2. Imports CrystalDecisions.Shared
    3. Public Class Form1
    4.     Private Sub ConfigureCrystalReports()
    5.         Dim reportPath As String = "F:\ProCoS\crystals\scrapreport.rpt"
    6.         MyCrystalReportsViewer.ReportSource = reportPath
    7.         Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
    8.         myConnectionInfo.DatabaseName = "CentralOps"
    9.         myConnectionInfo.UserID = "sql"
    10.         myConnectionInfo.Password = "hmpsql"
    11.         SetDBLogonForReport(myConnectionInfo)
    12.     End Sub
    13.  
    14.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    15.         ConfigureCrystalReports()
    16.     End Sub
    17.     Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo)
    18.         Dim myTableLogOnInfos As TableLogOnInfos = MyCrystalReportsViewer.LogOnInfo
    19.         For Each myTableLogOnInfo As TableLogOnInfo In myTableLogOnInfos
    20.             myTableLogOnInfo.ConnectionInfo = myConnectionInfo
    21.         Next
    22.     End Sub
    23. End Class
    Last edited by ramerra; Dec 27th, 2007 at 09:40 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width