简单加载方式:
Merchant temp = new Merchant();//得到数据集
ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("Class1", temp.GreatList("")));//Class1是数据对象,类似DataSet
ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Report.rdlc");//必须指定明确的路径地址,好像不能是URL
本文介绍了一种使用C#简单加载RDLC报告的方法。通过创建Merchant对象并调用其GreatList方法获取数据集,然后将数据源设置为ReportViewer控件的ReportDataSource属性,并指定报告文件的路径。
3309

被折叠的 条评论
为什么被折叠?



