问一个很简单的报表绑定的问题
从来没使用过报表...
属于完全不会那种...
新建一个页面Default.aspx(网页WebForm)
1.添加ReportViewer控件
2.在项目中添加报表rpt.rdlc
在rpt.rdlc中添加几个textbox,用来显示内容的.
然后在页后台写代码
DataTable dt = db.ExecuteDataTable("select * from admin"); //db为封装好的类,返回DataTable结果 ReportDataSource rds = new ReportDataSource("dtResult", dt); rpvBill.LocalReport.ReportPath = MapPath("rpt.rdlc"); rpvBill.LocalReport.DataSources.Add(rds); rpvBill.LocalReport.Refresh();