问题描述
大家好,
我有一个名为RepF
的Windows窗体,其中包含一个名为reportViewer1
的Microsoft报表查看器.
在此reportViewer1
加载事件中,我将创建5个DataTables
并通过MySqlDataAdapters
填充它们.
我需要在Report1.rdlc
中使用这些DataTables
中包含的数据,以便进行打印.
我想知道的是,如何在仍然在reportViewer1
Load事件方法中填充DataTables
之后直接在运行时创建数据集并将其添加到数据表中?
之后,我认为我可以将DataSet
添加为我的Report1.rdlc
的数据源,并将DataTables
字段拖放到Report1.rdlc
文本框和表格中.
提前致谢! :)
Hi all,
I have a windows Form named RepF
which contains a Microsoft Report Viewer named reportViewer1
.
In this reportViewer1
Load event, I am creating 5 DataTables
and populating them through MySqlDataAdapters
.
I need to use the data contained in these DataTables
in a Report1.rdlc
, for them to be printed.
What I want to know is, how can I create a DataSet and add my DataTables into it on running time, straight after I populate my DataTables
still in the reportViewer1
Load event method?
After this I think I''ll be able to add this DataSet
as a data source of my Report1.rdlc
and drag and drop the DataTables
fields into the Report1.rdlc
text boxes and tables.
Thanks in advance! :)
推荐答案
这篇关于DataSet和DataTable在运行时进行报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!