我试图在运行时将 DataTable
绑定到 winforms
winforms
但是我在 reportviewer
中收到此消息(不例外)“
尚未指定报告定义的来源“
这是我的代码:
this.rptViewer.LocalReport.DataSources.Clear();
ReportDataSource rprtDTSource = new ReportDataSource(dt.TableName, dt);
this.rptViewer.LocalReport.DataSources.Add(rprtDTSource);
this.rptViewer.RefreshReport();
有任何想法吗?
1 回答
试试这个:
得到了here (Codeproject)的答案 .