我遇到了一个问题,即在 SSRS 2005 上运行的 .RDL 报告(远程处理)在通过 Web 浏览器查看时将呈现表达式评估:
http://my-server/ReportServer/Pages/ReportViewer.aspx?/Group%20Reports/Report_Lines&rs:Command=Render
但是,当在 C# 应用程序中运行时(通过 Microsoft.Reporting.WinForms.ReportViewer 控件),报表呈现时似乎没有评估报表中内置的表达式。
需要注意的一些事项:
myReportViewer.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;
- 表达式通常具有条件格式性质 - 颜色变化取决于值等。
- 据我所知(我已经花了几个小时谷歌搜索/MSDN/看这里等),在服务器端运行表达式 eval 时,问题归结为信任/凭据。
另外,调用报表时 ReportServer__06_07_2011_07_57_20.log 的差异:
WEBforms
-=-=-=-=-
w3wp!library!7!06/07/2011-11:10:47:: Call to GetPermissionsAction(/Scorecard Reports/Report_Lines).
w3wp!library!7!06/07/2011-11:10:48:: Call to GetPermissionsAction(/Scorecard Reports/Report_Lines).
w3wp!library!7!06/07/2011-11:10:48:: Call to GetPermissionsAction(/Scorecard Reports/Report_Lines).
w3wp!library!7!06/07/2011-11:10:48:: Call to GetPermissionsAction(/Scorecard Reports/Report_Lines).
w3wp!library!7!06/07/2011-11:10:48:: Call to GetPermissionsAction(/Scorecard Reports).
w3wp!library!7!06/07/2011-11:10:49:: Call to GetPermissionsAction(/Scorecard Reports/Report_Lines).
w3wp!library!7!06/07/2011-11:10:49:: Call to GetPropertiesAction(/Scorecard Reports/Report_Lines, PathBased).
w3wp!library!7!07/06/2011-11:10:59:: i INFO: Call to RenderFirst( '/Scorecard Reports/Report_Lines' )
w3wp!library!7!07/06/2011-11:11:01:: i INFO: Call to RenderNext( '/Scorecard Reports/Report_Lines' )
w3wp!cache!7!07/06/2011-11:11:01:: i INFO: Session live: /Scorecard Reports/Report_Lines
w3wp!library!1!07/06/2011-11:11:03:: i INFO: Call to RenderNext( '/Scorecard Reports/Report_Lines' )
w3wp!cache!1!07/06/2011-11:11:03:: i INFO: Session live: /Scorecard Reports/Report_Lines
w3wp!library!1!07/06/2011-11:11:03:: i INFO: Call to RenderNext( '/Scorecard Reports/Report_Lines' )
w3wp!cache!1!07/06/2011-11:11:03:: i INFO: Session live: /Scorecard Reports/Report_Lines
w3wp!library!1!07/06/2011-11:11:04:: i INFO: Call to RenderNext( '/Scorecard Reports/Report_Lines' )
w3wp!cache!1!07/06/2011-11:11:04:: i INFO: Session live: /Scorecard Reports/Report_Lines
w3wp!library!1!07/06/2011-11:11:31:: i INFO: Call to RenderFirst( '/Scorecard Reports/Report_Lines' )
-=-=-=-=-
...vs...
WINforms
-=-=-=-=-
w3wp!library!7!06/07/2011-11:13:08:: i INFO: Call to RenderFirst( '/Scorecard Reports/Scorecard_Report' )
w3wp!webserver!7!06/07/2011-11:13:08:: i INFO: Processed report. Report='/Scorecard Reports/Scorecard_Report', Stream=''
-=-=-=-=-
基本上,我很乐意去日志拖网获取更多信息——但我不知道该去哪里找。
有没有人告诉我下一步该往哪里看?
tl;dr: Winforms.ReportViewer不评估表达式,而 Webforms.ReportViewer正在评估表达式。