For our reporting environment, we allow users to run reports "online" (the code for this is based on CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument) or "offline" which is to schedule them on the Business Objects server directly. This code is based on CrystalDecisions.Enterprise.Desktop.Report.
For the online report, we're able to programmatically set the provider with this code:
If crTableNew.ConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE Then
crLogonInfo = CType(crAttributes("QE_LogonProperties"), PropertyBag)
crLogonInfo("Data Source") = serverName
crLogonInfo("Initial Catalog") = databaseName
crLogonInfo("Provider") = "SQLNCLI11"
End If
However, the equivalent code for offline doesn't seem to expose the "Provider" property. The equivalent object is roughly this:
CrystalDecisions.Enterprise.Desktop.Report.ReportLogons.Item(tableIndex) but none of the properties there seem to be the Provider.
Anyone able to help?
The closest corresponding ReportLogon property to the LoginInfo Provider property is the ServerType property. However, I don't think you need this in order to set the database credentials.
You can probably do something like this
Looping through the TableLocationPrefixes ensures that all referenced tables or sprocs are associated to the database specified in the logon credentials.