winform 子报表数据源赋值

this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet2", ds_com.Tables[0]));
this.reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", dtDisHearder));

this.reportViewer1.LocalReport.SubreportProcessing += (s1, e1) => {
                        e1.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet2", ds_com.Tables[0]));
                    };

ReportParameter rp = new ReportParameter("logUser", DB.loginUserName);
this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp });

//FDA值

rp = new ReportParameter("fdaValue", _fdaValue.ToString());

this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp });

//非FDA值

rp = new ReportParameter("nFdaValue", _nFdaValue.ToString());

this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp });

rp = new ReportParameter("add_signor", strSignor);
this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp });
rp = new ReportParameter("addr_footer", strFooter);
this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp });
rp = new ReportParameter("addr_remark", strRemark);
this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp });                          
rp = new ReportParameter("totalValue", _totalPrice.ToString());
this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp });
this.reportViewer1.RefreshReport();

上一篇:Linux进程阻塞的相关知识


下一篇:innodb的锁