report rdlc 动态加载 数据源、参数

来源:互联网 发布:神经网络理论知乎 编辑:程序博客网 时间:2024/04/30 06:03

        ReportDataSource reportDataSource1 = new ReportDataSource("trade_P_ProjectInfo", db.ExecuteQuery(sql));
        reportViewer1.LocalReport.ReportPath = MapPath("rdlc/trade.rdlc");

        ReportParameter rptParaA = new ReportParameter("pTitle", txtTime.Text+"项目");
        reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rptParaA });

        reportViewer1.LocalReport.DataSources.Clear();
        reportViewer1.LocalReport.DataSources.Add(reportDataSource1);
        reportViewer1.LocalReport.Refresh();

trade_P_ProjectInfo 数据集名称

原创粉丝点击