SSRS 2008 & 2008 ReportViewer Web 控件 >在回发时,下拉值不会受到绑定和限制没有结果
我是一名长期读者,也是第一次发帖。我在网上查了两天没有结果,决定寻求帮助。让我们看看你们都得到了什么! :)
(抱歉,因为我是新用户,所以无法发布屏幕截图。白白浪费了所有时间。:()
情况如下:
1) 我创建了简单的 SSRS 2008 报告,其中包括一个单选下拉列表。为简单起见,我将“可用值”设置为一组固定值。 (如果将下拉列表绑定到结果集,也会发生此问题,因此数据源在这里似乎不相关。)
2) 在报表生成器和报表服务器本身上运行报表时,报表运行良好。
3) 但是,当从 ASP.NET 服务器“ReportViewer”控件显示报表时,单选下拉列表不会在回发时绑定。换句话说,当我在下拉列表中选择一个值并单击“查看报告”按钮时,报告不会返回结果,并且下拉列表将返回到所选选项“<选择一个值>”。
4) 此问题仅发生在单选下拉菜单中。多选下拉菜单、文本框、复选框等不存在此问题。
5) 作为参考,以下是该控件的设置方式。除了在后面的代码中设置 ReportPath(并且仅一次,第一次加载页面时)之外,我根本不操作该控件。
<rsweb:ReportViewer ID="ReportViewer1" runat="server"
ProcessingMode="Remote"
Width="100%"
Height="800px"
AsyncRendering="False">
</rsweb:ReportViewer>
6)我的开发环境:VS.NET 2010,ASP.NET Web Forms,.NET 4框架,Microsoft.ReportViewer.Common.dll(文件版本10.0.30319.1)
我已经在网上搜索了几天,我已经没有发现其他人有同样问题的参考,所以要么我做了明显错误的事情,要么我的谷歌搜索技巧很糟糕。我只发现一个讨论线程似乎相关并且提出了“解决方案” ”:他们创建了一个类,手动解析 ReportViewer 控件的回发值并将它们放入 List
有什么想法吗?
I'm a long time reader and first time poster. I have scoured the web for 2 days straight to no avail and decided to ask for help. Let's see what y'all got! :)
(Sorry, since I'm a new user I can't post screen shots. Spent all that time for nothing. :()
Here's the situation:
1) I created simple SSRS 2008 report that includes a single-select drop down. For simplicity I have set the "Available Values" to a fixed set of values. (This issue also happens if you bind the drop down to a a result set, so the source of data doesn't seem relevant here.)
2) The report runs fine when running it in Report Builder and on the report server itself.
3) However when displaying the report from the ASP.NET server "ReportViewer" control, the single select drop down doesn't get bound on postback. In other words, when I select a value in the drop down and click the "View Report" button, the report does not return results and the drop down goes back to the selected option "<Select a Value>".
4) This issue only happens with single-select drop downs. Multi-select dropdowns, text boxes, checkboxes etc do not have this issue.
5) For reference, here's how the control is set up. Aside from setting the ReportPath in the code behind (and only once, the first time the page is loaded), I don't manipulate the control at all.
<rsweb:ReportViewer ID="ReportViewer1" runat="server"
ProcessingMode="Remote"
Width="100%"
Height="800px"
AsyncRendering="False">
</rsweb:ReportViewer>
6) My development environment: VS.NET 2010, ASP.NET Web Forms, .NET 4 framework, Microsoft.ReportViewer.Common.dll (file version 10.0.30319.1)
I have scoured the web for a couple of days and I've found no references to others having this same problem and so either I'm doing something obviously wrong or my Googling skills suck. I found only one discussion thread that seemed related and had a proposed "solution": they created a class that manually parsed the ReportViewer control's posted-back values and put them into a List<ReportParameter> so that they could call ServerReport.SetParameters() manually (note: the solution on that page is for the VS.NET2005 control and needs to be tweaked to work with 2010). Sure, that'd work but why should I have to jump through that many hoops? Again, it leads me to believe I'm doing something fundamentally wrong.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否在后面的代码中设置了诸如
ReportPath
和ReportServerUrl
之类的内容?如果是这样,请确保它们位于
if (!Page.IsPostBack) { }
内Are you setting things like
ReportPath
andReportServerUrl
in the code behind?If so, make sure you have them inside
if (!Page.IsPostBack) { }