pull method of crystal report..promptin for password.
-
I am using pull method for viewing a crystal report. It works fine but it doesnt refresh the data..it still shows the old data. so i wrote some code to refresh the data..but it is prompting me for password...wen we give password it works..but even wen i give that password in code, it is prompting.. below is my code Dim rptDoc As New ReportDocument rptDoc.Load("test.rpt") ApplyInfo(rptDoc) CrystalReportViewer1.ReportSource = rptDoc Public Sub ApplyInfo(ByRef _oRpt As CrystalDecisions.CrystalReports.Engine.ReportDocument) Dim oCRDb As CrystalDecisions.CrystalReports.Engine.Database = _oRpt.Database Dim oCRTables As CrystalDecisions.CrystalReports.Engine.Tables = oCRDb.Tables Dim oCRTable As CrystalDecisions.CrystalReports.Engine.Table Dim oCRTableLogonInfo As CrystalDecisions.Shared.TableLogOnInfo Dim oCRConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo() oCRConnectionInfo.DatabaseName = _dbName oCRConnectionInfo.ServerName = _serverName oCRConnectionInfo.UserID = _userID oCRConnectionInfo.Password = _passWord For Each oCRTable In oCRTables oCRTableLogonInfo = oCRTable.LogOnInfo oCRTableLogonInfo.ConnectionInfo = oCRConnectionInfo oCRTable.ApplyLogOnInfo(oCRTableLogonInfo) Next End Sub
-
I am using pull method for viewing a crystal report. It works fine but it doesnt refresh the data..it still shows the old data. so i wrote some code to refresh the data..but it is prompting me for password...wen we give password it works..but even wen i give that password in code, it is prompting.. below is my code Dim rptDoc As New ReportDocument rptDoc.Load("test.rpt") ApplyInfo(rptDoc) CrystalReportViewer1.ReportSource = rptDoc Public Sub ApplyInfo(ByRef _oRpt As CrystalDecisions.CrystalReports.Engine.ReportDocument) Dim oCRDb As CrystalDecisions.CrystalReports.Engine.Database = _oRpt.Database Dim oCRTables As CrystalDecisions.CrystalReports.Engine.Tables = oCRDb.Tables Dim oCRTable As CrystalDecisions.CrystalReports.Engine.Table Dim oCRTableLogonInfo As CrystalDecisions.Shared.TableLogOnInfo Dim oCRConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo() oCRConnectionInfo.DatabaseName = _dbName oCRConnectionInfo.ServerName = _serverName oCRConnectionInfo.UserID = _userID oCRConnectionInfo.Password = _passWord For Each oCRTable In oCRTables oCRTableLogonInfo = oCRTable.LogOnInfo oCRTableLogonInfo.ConnectionInfo = oCRConnectionInfo oCRTable.ApplyLogOnInfo(oCRTableLogonInfo) Next End Sub
I had an issue similar to this awhile ago, i cant remember the exact code but you need to loop (Recursivly) through all the subreports and set the credentials for them aswell.
If at first you don't succeed ... post it on The Code Project and Pray.