How to bind datatable to reportviewer runtime(如何将数据表绑定到报表查看器运行时)
问题描述
我想使用以下代码将 datatable 绑定到 reportviewer.我在 reportviewer 中看不到结果,下面缺少脚本怎么办?
I want to do a bind datatable to reportviewer with the code below. I don't see the results appear in the reportviewer, what the lack of script below?
推荐答案
我找到了如何将数据表绑定到报表查看器的答案,我将在这里分享可能对其他人有用.
I found the answer how to bind datatable to reportviewer, I will shared here may be useful for others.
- 添加到表单clsTables 类、Report1.rdlc 文件、reportViewer1.
- 然后点击reportViewer1的右上角,将选择报告设置为Test.Report1.rdlc.
- 关于 Report1.rdlc
- 点击新建,
- 添加数据集名称:dsBody数据源:测试可用数据集:clsTables
- 点击确定
- 右键单击 Report1.rdlc 选择 插入表,将 dsBody 元素(Column0、Colum1、Column2)拖到 Report1.rdlc 表.
- Add to form clsTables class, Report1.rdlc file, reportViewer1.
- Then Click on the upper right corner of the reportViewer1, set choose report to Test.Report1.rdlc.
- On Report1.rdlc
- Click New,
- Add dataset name: dsBody Data source: Test Available dataset: clsTables
- Click Ok
- Right click on Report1.rdlc select Insert Table, drag dsBody element(Column0, Colum1, Column2) to Report1.rdlc table.
这篇关于如何将数据表绑定到报表查看器运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!