Integrating Lotus Notes 6.5.2 with Crystal Reports

We have a CRM database made in Lotus Notes. Now I am integrating it with Crystal Reports. I have embedded Crystal Reports Viewer Control 9 in the form. On the postopen event I am creating an object of the conrol and opening an .rpt file. For the report to work I have to pass in login information which is used by the control to connect to the specified Lotus Notes Database. Since this username and password have to passed everytime this report is displayed, so it will become irritating for users to enter password everytime.

We tried passing a pre-specified username and its password but that doesn’t work. It only allows the username of the currently logged in user to be passed. We get a Lotus Notes error message saying that logon failed.

Is their any .ini file setting which can allow simultaneous logon or a way to capture existing users password, so that he doesnt get the prompt every time and we pass it whenever needed using Lotuscript.

We have written the following code in the postopen event:

Dim m_Viewer As Variant

Set m_Viewer = Source.GetObject(“Crystal Report Viewer Control 9”)

’ The application object

Set App = CreateObject(“CrystalRuntime.Application”)

’ The report

Dim theReport As Variant

Set Rep = App.OpenReport("c:\temp"+sourcename)

’ The UserName

Dim UserName As New NotesName(Session.UserName)

’ Log On

Rep.Database.Table.(1).SetLogOnInfo ServerName, Database Name, Hierarchical UserName, password

Subject: Integrating Lotus Notes 6.5.2 with Crystal Reports

The pre-specified password & username should work. The following works for me: 'set crystal object

Set app = CreateObject("CrystalRuntime.Application")



Print "1. Set app to crystal object"		

	'set the report with path

Print "1.1 ap path is " + ReportDoc.txtReportPath(0) + ReportDoc.txtReportFileName(0)

Set report = app.OpenReport(ReportDoc.txtReportPath(0) + ReportDoc.txtReportFileName(0))

Print "2. open crystal report"

Dim dbt As Variant

Set dbt = report.database.tables(1)

Print 2.1	

Print dbt.name

Print 2.2		



 'get the connection name & password from the profile document

dbt.connectionProperties.Item("User ID") = profileDoc.txtReportUserID(0) 'The user		

dbt.connectionProperties.Item("Password") = profileDoc.txtReportPassword(0)	'The password



report.exportOptions.DestinationType = 1

Print "5. report file name is " + fileName

report.exportOptions.DiskFileName = fileName

report.exportOptions.FormatType = 31			



Print "6. Report Options set"

Call report.export(False)		'printing report to the output file specified above