Help with Crystal Reports
Hello, I am using Crystal Reports .NET for VB .NET. I am using a Crystal Report to load a list of payments for the company i work at. I got it all to work fine, except when I load the report through VB .NET it asks me to type in the database password, which wont work well since not everyone who will need to sue this program know the password, if any of them. Can anyone tell me how to save the password to the report somehow to avoid the login screen? Thanks in advance
****RESOLVED**** Help with Crystal reports
Heres the fix if you need it...
'Imports
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
'Variables
Dim repDoc As New AcctCard() ' your crystal report name
Dim subRepDoc As New ReportDocument()
Dim crSections As Sections
Dim crsection As Section
Dim crReportObjects As ReportObjects
Dim crReportObject As ReportObject
Dim crSubReportObject As SubreportObject
Dim crDatabase As Database
Dim crTables As Tables
Dim crTable As Table
Dim crLogOnInfo As TableLogOnInfo
Dim crConnInfo As New ConnectionInfo()
'in the Public Sub New() sub under the Region Windows Forms
'Generated Code
crDatabase = repDoc.Database
crTables = crDatabase.Tables
For Each crTable In crTables
With crConnInfo
.ServerName = "server name"
.DatabaseName = "db name"
.UserID = "user name"
.Password = "password "
End With
crLogOnInfo = crTable.LogOnInfo
crLogOnInfo.ConnectionInfo = crConnInfo
crTable.ApplyLogOnInfo(crLogOnInfo)
Next
crSections = repDoc.ReportDefinition.Sections
For Each crsection In crSections
crReportObjects = crsection.ReportObjects
For Each crReportObject In crReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject Then
crSubReportObject = CType(crReportObject, SubreportObject)
subRepDoc = crSubReportObject.OpenSubreport(crSubReportObject.SubreportName)
crDatabase = subRepDoc.Database
crTables = crDatabase.Tables
For Each crTable In crTables
With crConnInfo
.ServerName = "server name"
.DatabaseName = "db name"
.UserID = "user name"
.Password = "password "
End With
crLogOnInfo = crTable.LogOnInfo
crLogOnInfo.ConnectionInfo = crConnInfo
crTable.ApplyLogOnInfo(crLogOnInfo)
Next
End If
Next
Next
crView.ReportSource = repDoc
crView.DisplayGroupTree = False