Skip to Content
0
Former Member
Dec 06, 2011 at 08:41 PM

Automate crystal report (using Peoplesoft ODBC connection) from VB.NET

115 Views

Could anyone help with sample code to connect from .NET with crystal report which uses PeopleSoft ODBC connection.Below is the code i'm trying but i'm getting login failed error on below line of code,

reportDocument.VerifyDatabase()

ERROR Message:

Log on failed.

at CrystalDecisions.CrystalReports.Engine.ReportDocument.VerifyDatabase()

at CrystalReportPrint.Module1.SetDatabaseLogonForReport(ReportDocument& repor

tDocument) in D:\CrystalReportPrint\CrystalReportPrint\Module1.vb:line 114

at CrystalReportPrint.Module1.Main() in D:\CrystalReportPrint\CrystalReportPr

int\Module1.vb:line 36

-


'ODBC Name :"PeopleSoft PeopleTools"

'Oracle database Name: "INITTEST"

-


Below is my code,

Private Function GetConnectionInfo() As CrystalDecisions.Shared.ConnectionInfo

Dim dbAttributes As CrystalDecisions.Shared.DbConnectionAttributes

Dim crConnectionInfo As CrystalDecisions.Shared.ConnectionInfo = Nothing

'setup the attributes for the connection

dbAttributes = New CrystalDecisions.Shared.DbConnectionAttributes

dbAttributes.Collection.Set("Server", "PeopleSoft PeopleTools")

dbAttributes.Collection.Set("Trusted_Connection", False)

'setup the connection

crConnectionInfo = New CrystalDecisions.Shared.ConnectionInfo

crConnectionInfo.LogonProperties.Clear()

crConnectionInfo.Attributes.Collection.Clear()

crConnectionInfo.DatabaseName = "INITTEST"

crConnectionInfo.ServerName = "PeopleSoft PeopleTools"

crConnectionInfo.UserID = _UserName

crConnectionInfo.Password = _Password

crConnectionInfo.IntegratedSecurity = False

crConnectionInfo.Attributes.Collection.Set("Database DLL", "crdb_odbc.dll")

crConnectionInfo.Attributes.Collection.Set("QE_DatabaseName", "INITTEST")

crConnectionInfo.Attributes.Collection.Set("QE_DatabaseType", "ODBC (RDO)")

crConnectionInfo.Attributes.Collection.Set("QE_LogonProperties", dbAttributes)

crConnectionInfo.Attributes.Collection.Set("QE_ServerDescription", "")

crConnectionInfo.Attributes.Collection.Set("QE_SQLDB", True)

crConnectionInfo.Attributes.Collection.Set("SSO Enabled", False)

crConnectionInfo.LogonProperties = dbAttributes.Collection

Return crConnectionInfo

End Function