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