当前位置:编程学习 > C#/ASP.NET >>

rdlc报表: 一个dataTable 填充多个表格

rdlc报表里有多个表的字段是相同的。我想用数据源的一个DataTable,根据不同的sql语句 得到不同的dataset 填充相应的表。

可是不行。只能建多个字段相同,但表名不同的datatable。

谁知道是怎么回事。 --------------------编程问答-------------------- 顶顶 --------------------编程问答-------------------- 没人知道吗 --------------------编程问答-------------------- 动态绑定RDLC报表数据源:
Microsoft.Reporting.WinForms.LocalReport report = new Microsoft.Reporting.WinForms.LocalReport();
report.ReportPath = strReportPath;
report.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource(strReportSourceName, dtSource));//strReportSourceName:rdlc绑定的数据源名称,dtSource:动态数据源,根据不同SQL生成
有一个点需要注意就是dtSource里面的字段应该包含rdlc绑定的字段,strReportSourceName一定要和你设计rdlc报表时绑定的那个数据源同名 --------------------编程问答-------------------- --------------------编程问答-------------------- 直接把不同的数据源绑定就可以了。 --------------------编程问答-------------------- 重组datatable 绑定报表
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,