Hi All,
I am able to run the single crystal report for both SQL and Oracle using ReplaceConnection method.
Now i am facing one minor issue as When i open the SQL report using Oracle connection, it prompt the login window and i have to enter User Id and Password for the same (it may be as Oracle dont have any Integrated Security=True) .
Actually i do provide the all the login information in the code only.
However i am not facing this problem while i am connected to SQL Server(as Integrated Security=True for SQL Server).
Please let me know how to suppress login window while connected to Oracle.
I am using following code:.
I am using following code :
Private Sub ReplaceConnection_Click()
Dim rcd As ISCDReportClientDocument
rcd = New ReportClientDocument()
rcd = m_oGenericReport.ReportClientDocument
rcd.DatabaseController.LogonEx(m_oConnectionInfo.ServerName, m_oConnectionInfo.DatabaseName, m_oConnectionInfo.UserID, m_oConnectionInfo.Password)
Dim QE_Details As New CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag()
If m_oDatabaseType = Common.Enums.DataBaseType.Oracle Then
'Create the logon propertybag for the connection we wish to use
Dim logonDetails As New CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag()
logonDetails.Add("Auto Translate", -1)
logonDetails.Add("Connect Timeout", 15)
logonDetails.Add("Data Source", m_oConnectionInfo.ServerName)
logonDetails.Add("General Timeout", 0)
logonDetails.Add("Initial Catalog", m_oConnectionInfo.DatabaseName)
logonDetails.Add("Integrated Security", "False")
logonDetails.Add("Locale Identifier", 1033)
logonDetails.Add("OLE DB Services", -5)
logonDetails.Add("Provider", "OraOLEDB.Oracle")
logonDetails.Add("Use Encryption for Data", 0)
logonDetails.Add("Owner", m_oConnectionInfo.UserID)
logonDetails.Add("User ID", m_oConnectionInfo.UserID)
logonDetails.Add("Password", m_oConnectionInfo.Password)
'Create the QE (query engine) propertybag with the provider details and logon property bag.
QE_Details.Add("Database DLL", "crdb_ado.dll")
QE_Details.Add("QE_DatabaseName", m_oConnectionInfo.DatabaseName)
QE_Details.Add("QE_DatabaseType", "OLE DB (ADO)")
QE_Details.Add("QE_LogonProperties", logonDetails)
QE_Details.Add("QE_ServerDescription", m_oConnectionInfo.ServerName)
QE_Details.Add("QE_SQLDB", "True")
QE_Details.Add("SSO Enabled", "False")
QE_Details.Add("Owner", m_oConnectionInfo.UserID)
Else
'Create the logon propertybag for the connection we wish to use
Dim logonDetails As New CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag()
logonDetails.Add("Auto Translate", -1)
logonDetails.Add("Connect Timeout", 15)
logonDetails.Add("Data Source", m_oConnectionInfo.ServerName)
logonDetails.Add("General Timeout", 0)
logonDetails.Add("Initial Catalog", m_oConnectionInfo.DatabaseName)
logonDetails.Add("Integrated Security", "True")
logonDetails.Add("Locale Identifier", 1033)
logonDetails.Add("OLE DB Services", -5)
logonDetails.Add("Provider", "SQLOLEDB")
logonDetails.Add("Use Encryption for Data", 0)
logonDetails.Add("Owner", "dbo")
' schema
'Create the QE (query engine) propertybag with the provider details and logon property bag.
QE_Details.Add("Database DLL", "crdb_ado.dll")
QE_Details.Add("QE_DatabaseName", m_oConnectionInfo.DatabaseName)
QE_Details.Add("QE_DatabaseType", "OLE DB (ADO)")
QE_Details.Add("QE_LogonProperties", logonDetails)
QE_Details.Add("QE_ServerDescription", m_oConnectionInfo.ServerName)
QE_Details.Add("QE_SQLDB", "True")
QE_Details.Add("SSO Enabled", "False")
QE_Details.Add("Owner", "dbo")
End If
Dim newConnInfo As New CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo()
Dim oldConnInfo As CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo
Dim oldConnInfos As CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfos
oldConnInfos = rcd.DatabaseController.GetConnectionInfos(Nothing)
For I As Integer = 0 To oldConnInfos.Count - 1
oldConnInfo = oldConnInfos(I)
newConnInfo.Attributes = QE_Details
newConnInfo.Kind = CrystalDecisions.ReportAppServer.DataDefModel.CrConnectionInfoKindEnum.crConnectionInfoKindCRQE
rcd.DatabaseController.ReplaceConnection(oldConnInfo, newConnInfo, Nothing, CrystalDecisions.ReportAppServer.DataDefModel.CrDBOptionsEnum.crDBOptionDoNotVerifyDB)
Next
End Sub
I have even tried hardcoding the login information, stillnot working.
Whether i am missing something over here ?
Please let me know if you do have any solution for this.
Thanks for your help.
Thanks,
Prashant