Sunday, July 18, 2010

Dyamically set User Name , Password for crystal report.

myReportDocument.SetDatabaseLogon(user, pwd, Servername, Database)
Dim Logoninfo As New TableLogOnInfo()
Logoninfo.ConnectionInfo.ServerName = Servername
Logoninfo.ConnectionInfo.DatabaseName = Database
Logoninfo.ConnectionInfo.UserID = user
Logoninfo.ConnectionInfo.Password = pwd
myReportDocument.Database.Tables().Item(0).ApplyLogOnInfo(Logoninfo)
myReportDocument.VerifyDatabase()

No comments:

Post a Comment