Skip to Content
author's profile photo Former Member
Former Member

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

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,


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.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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Dec 06, 2011 at 08:51 PM
    Add a comment
    10|10000 characters needed characters exceeded

    • Hello,

      You are using the Report Engine in your app, add the Report Application Server also. That app to generate code uses RAS to set the log on info:

      using CrystalDecisions.CrystalReports.Engine;

      using CrystalDecisions.Shared;

      using CrystalDecisions.ReportAppServer.ClientDoc;

      using CrystalDecisions.ReportAppServer.Controllers;

      using CrystalDecisions.ReportAppServer.ReportDefModel;

      using CrystalDecisions.ReportAppServer.CommonControls;

      using CrystalDecisions.ReportAppServer.CommLayer;

      using CrystalDecisions.ReportAppServer.CommonObjectModel;

      using CrystalDecisions.ReportAppServer.ObjectFactory;

      using CrystalDecisions.ReportAppServer.DataSetConversion;

      using CrystalDecisions.ReportAppServer.DataDefModel;

      using CrystalDecisions.ReportSource;

      using CrystalDecisions.Windows.Forms;

      You may want to check with PS to see if they support what you are doing. You may need other properties to be set in the connection info.



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.