RDLC 报告未刷新回发上的显示
我正在开发一个 ASP.NET 网站,并且在一个页面上有一个带有两个视图的多视图。 View1 有一些过滤器和一个提交按钮(回发和显示视图 2)。 View2 有几个 RDLC 报告和一个更改过滤器按钮(回发和显示视图 1)。
我第一次加载页面时一切正常。我选择过滤器并进行搜索,然后我的两个报告加载了数据。但是,如果我在再次提交时“更改过滤器”,则只有第一个报告会使用新数据更新,而第二个报告则不会。 aspx 代码几乎相同,只是第一个报表有一个需要设置的参数,以便它具有“OnLoad”属性。
有谁知道什么会导致这种行为?或者即使您不知道原因是什么,有人知道如何强制重新生成第二份报告吗?我尝试了 Report.DataBind() 和 ObjectDataSource.Select() ,但它们都没有导致报告更新。
我使用的是 Visual Studio 2008。两个报表都有一个对象数据源,并且两个数据源都有使用 dataSource_Selecting 事件从 View1 筛选器填充的输入参数。
I'm working on an ASP.NET website and on a page I have a multi-view with two views. View1 has some filters and a submit button (postback and display view 2). View2 has a couple RDLC reports and a change filters button (postback and display view 1).
The first time I load the page everything works fine. I choose my filters and search and my two reports load with the data. But if I "change filters" when I submit again only the first report updates with the new data and the second one does not. The aspx code is almost identical except that the first report has a parameter that needs to be set so it has an "OnLoad" property.
Does anybody know what would cause this behavior? Or even if you don't know what causes it does anybody know how to force the second report to re-generate? I tried Report.DataBind() and ObjectDataSource.Select() and neither of them caused the report to update.
I am using Visual Studio 2008. Both reports have an object data source and both data sources have input parameters that get populated from the View1 filters using the dataSource_Selecting event.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
就我而言,使用“
ReportViewer1.LocalReport.Refresh()
”在“搜索”按钮 OnClick 事件结束时完成了这项工作。In my case, using the '
ReportViewer1.LocalReport.Refresh()
' did the job at the end of 'Search' Button OnClick event.ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Clear();