Crystal reports 如何设置CrystalDecisions.Enterprise.Desktop.Report的提供程序?
对于我们的报告环境,我们允许用户“在线”运行报告(代码基于CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument)或“离线”运行报告,即直接在Business Objects server上调度报告。此代码基于CrystalDecisions.Enterprise.Desktop.Report 对于联机报告,我们可以使用以下代码以编程方式设置提供程序:Crystal reports 如何设置CrystalDecisions.Enterprise.Desktop.Report的提供程序?,crystal-reports,business-objects,business-objects-sdk,Crystal Reports,Business Objects,Business Objects Sdk,对于我们的报告环境,我们允许用户“在线”运行报告(代码基于CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument)或“离线”运行报告,即直接在Business Objects server上调度报告。此代码基于CrystalDecisions.Enterprise.Desktop.Report 对于联机报告,我们可以使用以下代码以编程方式设置提供程序: If crTableNew.ConnectionInfo.Kind =
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
但是,脱机的等效代码似乎没有公开“Provider”属性。等效对象大致如下:
CrystalDecisions.Enterprise.Desktop.Report.ReportLogons.Item(tableIndex),但其中的属性似乎都不是提供者
任何能够提供帮助的人?与LoginInfo提供程序属性最接近的对应ReportLogon属性是ServerType属性。但是,我认为设置数据库凭据不需要这个 你也许可以这样做
foreach(ReportLogon reportLogon in reportLogons)
{
reportLogon.UseOriginalDataSource = false;
reportLogon.CustomServerName = serverName;
reportLogon.CustomUserName = userId;
reportLogon.CustomPassword = password;
reportLogon.CustomDatabaseName = databaseName;
foreach(TablePrefix tablePrefix in reportLogon.TableLocationPrefixes)
{
tablePrefix.MappedTablePrefix = databaseName + ".dbo.";
tablePrefix.UseMappedTablePrefix = true;
}
}
循环使用TableLocationPrefixes可确保所有引用的表或存储过程都与登录凭据中指定的数据库相关联。无法设置提供程序最终是我们的一大障碍。提供商变更的动机是要求我们在我们的环境中禁用TLS 1.0/1.1-新提供商基本上是要求与TLS 1.2兼容。我们最终只需手动设置eaach报告的提供程序并重新发布它们,但我们有数百份报告:(