小编ala*_*deh的帖子

如何将Datatable设置为ReportViewer中的数据源

我在搜索有关Datatableas 的最后一个问题datasourceReportViewer,发现这是解决方案

DataTable table = new DataTable();
table.Columns.Add("value", typeof(string));
table.Columns.Add("price", typeof(string));
table.Columns.Add("quantity", typeof(string));

table.Rows.Add("test1","10","20");
table.Rows.Add("test2", "10", "20");

reportViewer1.LocalReport.DataSources.Clear();

ReportDataSource rprtDTSource = new ReportDataSource("TITLE",table);

reportViewer1.LocalReport.DataSources.Add(rprtDTSource);
reportViewer1.RefreshReport();
Run Code Online (Sandbox Code Playgroud)

但是我得到这个图像

在此处输入图片说明

问题是什么 ??

c# datatable reportviewer localreport winforms

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

c# ×1

datatable ×1

localreport ×1

reportviewer ×1

winforms ×1