SSRS 2008 & 2008 ReportViewer Web 控件 >在回发时,下拉值不会受到绑定和限制没有结果

发布于 2024-12-08 09:25:33 字数 1253 浏览 0 评论 0原文

我是一名长期读者,也是第一次发帖。我在网上查了两天没有结果,决定寻求帮助。让我们看看你们都得到了什么! :)

(抱歉,因为我是新用户,所以无法发布屏幕截图。白白浪费了所有时间。:()

情况如下:

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中;这样他们就可以手动调用 ServerReport.SetParameters() (注意:该页面上的解决方案适用于 VS.NET2005 控件,需要进行调整以适用于 2010)。当然,这可行,但为什么我要经历那么多麻烦呢?这再次让我相信我正在做一些根本错误的事情。

有什么想法吗?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甚是思念 2024-12-15 09:25:33

您是否在后面的代码中设置了诸如 ReportPathReportServerUrl 之类的内容?

如果是这样,请确保它们位于 if (!Page.IsPostBack) { }

Are you setting things like ReportPath and ReportServerUrl in the code behind?

If so, make sure you have them inside if (!Page.IsPostBack) { }

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文