使用 BindingSource 对 ReportViewer 中的报表数据进行排序
我试图让 ReportViewer 显示来自 BindingSource (VB.Net Winforms) 的数据。
我根据基础数据集构建了报告。 然后我将数据源实例配置为 BindingSource。 我认为这会应用排序、过滤等。但看起来数据来自数据集而不是 BindingSource。
我怀疑我错过了一些简单的事情。
更新:或者也许事情没那么简单 - 我几天前发布了这个,但仍然没有人知道答案! 也许我正在尝试做一些无法完成的事情?
I'm trying to get ReportViewer to display data from a BindingSource (VB.Net Winforms).
I built the report on the underlying dataset. Then I configured the Data Source Instance to the BindingSource. I thought that would apply the sorting, filtering, etc. But it just looks like the data is coming from the dataset instead of the BindingSource.
I suspect I'm missing something simple.
Update: Or maybe it isn't so simple - I posted this a few days ago and still nobody knows the answer! Maybe I'm trying to do something that can't be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要在报告中(在 RDL 中)指定排序,因为它应用自己的排序逻辑。
You'll need to specify the sorting in the report (in the RDL), since it applies its own sorting logic.
这是我使用的解决方案。 您将 BindingSource 中的数据放入 DataTable 中,然后让报表使用 DataTable。
Here's a solution I used. You put the data from the BindingSource into a DataTable and then have the Report use the DataTable.