(请注意,这不是第一次运行的唯一问题,每次都会发生这种情况)
我想知道是否有人遇到过以下情况。
我们创建了从 SSRS 实例生成报告的 ac# 应用程序。
当我在 SSRS 实例所在的服务器上运行此应用程序时,报告会在 +- 6 秒内生成。
当我从远程机器(相同的网络,只是与 SSRS 实例不同的电脑)运行完全相同的应用程序时,相同的报告需要 +- 18 秒。
使用的代码类似于
ServerReport report = new ServerReport();
report.ReportServerUrl = new System.Uri(reportSetup.ConnectionString);
report.ReportServerCredentials.NetworkCredentials = System.Net.CredentialCache.DefaultCredentials;
report.ReportPath = reportName;
report.SetParameters(reportParams);
byte[] bytes = report.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);
ServerReport
来自哪里
Microsoft.Reporting.WinForms
(C:\Program Files (x86)\Microsoft Visual Studio 10.0\ReportViewer\Microsoft.ReportViewer.WinForms.dll
但也尝试了网络版本),其余的被声明为
Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string extension;
List<ReportParameter> reportParams
并且 reportSetup.ConnectionString 的形式是http://<server name>/ReportServer
(这里的服务器名称是实际名称,但我也尝试过使用 IP)。
我对上述每个步骤进行了计时,anf 发现罪魁祸首在它设置参数的那一行。所以我将参数值存储在实际报告中的默认值中,并删除了该步骤。然后渲染只需要比以前更长的时间。
除此之外,我还尝试将 Reporting Service Configuration Manager 服务帐户从网络更改为本地帐户,并使用在配置文件 (rsreportserver.config) 中找到的身份验证设置C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer
最初的身份验证设置是
<Authentication>
<AuthenticationTypes>
<RSWindowsNegotiate/>
<RSWindowsNTLM/>
</AuthenticationTypes>
<RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel>
<RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario>
<EnableAuthPersistence>true</EnableAuthPersistence>
</Authentication>
我从Reporting Services 中的身份验证类型中<RSWindowsNegotiate/>
读取时删除了该行
RSWindows协商
RSWindowsNegotiate 指示报表服务器处理指定 Negotiate 的身份验证请求。协商首先尝试 Kerberos 身份验证,但如果 Active Directory 无法将客户端请求的票证授予报表服务器,则回退到 NTLM。仅当票证不可用时,协商才会退回到 NTLM。如果第一次尝试导致错误而不是丢失票证,则报表服务器不会进行第二次尝试。
但这没有帮助。
有人对如何更正代码或 SSRS 安装有任何想法吗?我希望应用程序位于与 SSRS 实例不同的服务器上。