我在我的项目中使用RDLC报告。
protected void btnview_Click(object sender, EventArgs e)
{
ReportViewer1.ProcessingMode = ProcessingMode.Local;
ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Report.rdlc");
MyDataset dsreceipt = GetDataItem("select * from tblGeneratedReceipt ");
ReportDataSource datasource = new ReportDataSource("Receipt", dsreceipt.Tables[0]);
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(datasource);
}
private MyDataset GetDataItem(string p)
{
SqlCommand cmd = new SqlCommand(p,conn);
SqlDataAdapter adp = new SqlDataAdapter(cmd);
MyDataset rec = new MyDataset();
adp.Fill(rec, "DataTable1");
return rec;
}
我在网上收到错误 private MyDataset GetDataItem(string p) 错误是关于缺少程序集引用
答案 0 :(得分:1)
我通过ReportViewer控件看到了类似的内容;你可以检查你的bin目录中是否有以下正确的版本: -