Question

I am using RDLC report in my project.

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;
    }

I am getting error on line private MyDataset GetDataItem(string p) Error is about Missing assembly reference

Was it helpful?

Solution

I've seen something similar to this with the ReportViewer control; can you check that you have the correct versions of the following in your bin directory: -

  • Microsoft.ReportViewer.Common.dll
  • Microsoft.ReportViewer.ProcessingObjectModel.dll
  • Microsoft.ReportViewer.WebForms.dll
  • Microsoft.ReportViewer.WinForms.dll
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top