report.rdlc自定义数据源连接

来源:互联网 发布:dnf组队队员网络冲突 编辑:程序博客网 时间:2024/05/16 15:04

string str_sql = "select customer_no,baby_name,baby_birthday,baby_sex,dad_name,dad_tel,mum_name,mum_tel from t_customer where customer_no='"+MyModule .customerno +"'";
            DataSet DataSet1 = cls.Getds(str_sql, "customer");
            string str_sql2 = "select t_order.remark,t_order.order_no,t_order.booking_date,t_order.ms,t_package.package_name,t_order.booking_price,t_order.pre_camera_date,t_order.clother_num,t_order.pic_num from t_order inner join t_package on t_order.package_no=t_package.package_no where order_no='"+MyModule .orderno +"'";
            DataSet DataSet2 = cls.Getds(str_sql2, "order");
            string str_sql3 = "select t_product.product_name,t_orderitem.product_num,t_orderitem.pages,t_orderitem.photo_num from t_orderitem inner join t_product on t_orderitem.product_no=t_product.product_no where order_no='"+MyModule .orderno +"' ";
            DataSet DataSet3 = cls.Getds(str_sql3, "orderitem");
            string str_sql4 = "select store_name,store_tel,store_address from t_store where store_no='" + MyModule.Store_No + "'";
            DataSet DataSet4 = cls.Getds(str_sql4, "store");
            //ReportDataSource rds = new ReportDataSource();
            //rds.Value = ds.Tables[0];
            //rds.Name = "order";
            //this.reportViewer1.LocalReport.DataSources.Add(rds);
            //reportViewer1.ProcessingMode = ProcessingMode.Local;

 

            ReportDataSource rds = new ReportDataSource("DataSet1", DataSet1.Tables[0]);
            ReportDataSource rds2 = new ReportDataSource("DataSet2", DataSet2.Tables[0]);
            ReportDataSource rds3 = new ReportDataSource("DataSet3", DataSet3.Tables[0]);
            ReportDataSource rds4 = new ReportDataSource("DataSet4", DataSet4.Tables[0]);
            //reportViewer1.LocalReport.DataSources.Clear();
            reportViewer1.LocalReport.DataSources.Add(rds);
            reportViewer1.LocalReport.DataSources.Add(rds2);
            reportViewer1.LocalReport.DataSources.Add(rds3);
            reportViewer1.LocalReport.DataSources.Add(rds4);
            this.reportViewer1.RefreshReport();

0 0
原创粉丝点击