当图像路径保存在Access数据库中时,如何在rdlc报告中显示图像

时间:2019-01-02 15:30:10

标签: c# asp.net rdlc

我想在rdlc报告的表列中显示图像asp.net,图像路径保存在Access数据库中,我试图这样做但没有成功,我希望表的每一行都显示其图像要显示,看看我有什么

  //reset data
        prgreport.Reset();
        // datasource
        DataTable dts = getdata(txtprop.Text);
        DataTable dc = getsub(txtprop.Text);
        prgreport.Visible = true;
        ReportDataSource ds = new ReportDataSource("byproGRdataset", dts);
        ReportDataSource dss = new ReportDataSource("propM", dc);
        prgreport.LocalReport.DataSources.Add(ds);
        prgreport.LocalReport.DataSources.Add(dss);
        //path
        prgreport.LocalReport.ReportPath = "marksbyprGR.rdlc";
        //parameters
        prgreport.LocalReport.EnableExternalImages = true;
        ReportParameter pr = new ReportParameter("Proprietor", txtprop.Text);
        prgreport.LocalReport.SetParameters(pr);

        prgreport.LocalReport.Refresh();


    }
    private DataTable getdata(string valu)
    {
        DataTable dt = new DataTable();
        string constring = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString17"].ConnectionString;
        using (OleDbConnection con = new OleDbConnection(constring))
        {
            OleDbCommand comm = new OleDbCommand("SELECT DISTINCTROW [Mark],[TMNumber],[TMCountry],[Class],[RenDate],[Status],[Comments],[GoodsServices],[logo] FROM Mark WHERE [Proprietor] like '%'+@SearchText+'%' GROUP BY [Mark],[TMNumber],[TMCountry],[Class],[Comments],[RenDate],[Status],[GoodsServices],[logo] ORDER BY [Mark],[Class],[TMCountry]", con);
            comm.CommandType = CommandType.Text;
            comm.Parameters.AddWithValue("@SearchText", valu);
            OleDbDataAdapter adp = new OleDbDataAdapter(comm);

            adp.Fill(dt);
        }
        return dt;
    }

0 个答案:

没有答案