private void GetWqpWorkPrinter(List<ReelListMagt> list, string WorkDate, User user) { ReelListMagtService service = new ReelListMagtService(); #region 数据源 DataSet ds = new DataSet(); DataTable dt_Main = service.GetWqpWorkHeader(list, WorkDate, user).Tables[0]; dt_Main.TableName = "parent"; ds.Tables.Add(dt_Main.Copy()); DataTable dt_detail = service.GetWqpWorkDetailed(list).Tables[0]; dt_detail.TableName = "child"; ds.Tables.Add(dt_detail.Copy()); //设置主表和从表的父子关系 DataColumn parentColumn = ds.Tables["parent"].Columns["REEL_NO"]; DataColumn childColumn = ds.Tables["child"].Columns["REEL_NO"]; DataRelation R1 = new DataRelation("R1", parentColumn, childColumn); ds.Relations.Add(R1); #endregion this.GroupHeader1.GroupFields.Add(new GroupField("REEL_NO", XRColumnSortOrder.Ascending)); #region Main this.DetailReport.DataSource = ds; this.DetailReport.DataMember = "parent"; LINE_INFO.DataBindings.Add("Text", ds, "LINE_INFO"); BASIC_MODEL_CODE.DataBindings.Add("Text", ds, "BASIC_MODEL_CODE"); PO.DataBindings.Add("Text", ds, "PO"); PGM_ID.DataBindings.Add("Text", ds, "PGM_ID"); TB_CODE.DataBindings.Add("Text", ds, "TB_CODE"); MODEL_CODE.DataBindings.Add("Text", ds, "MODEL_CODE"); PCB.DataBindings.Add("Text", ds, "PCB"); FW.DataBindings.Add("Text", ds, "FW_NM"); // Barcode.DataBindings.Add("Text", ds, "BARCODE"); LBLEQUIPID.DataBindings.Add("Text", ds, "EQUIP_ID");//Text = EQUIP_ID; LBLLINECODE.DataBindings.Add("Text", ds, "LINE_CODE");//Text = LINE_CODE; LBLPRINTER.Text = user.USER_NM; LBLPRINTDATE.Text = DateTime.Now.ToString("yyyy-MM-dd hh:MM:ss"); //--------------------条形码------------------- xrBarCode1.DataBindings.Add("Text", ds, "REEL_NO"); xrBarCode4.DataBindings.Add("Text", ds, "LINE_CODE_EQUIP_ID");//Text = "CHN" + LINE_CODE + EQUIP_ID; xrBarCode3.DataBindings.Add("Text", ds, "PGM_ID"); #endregion DetailReport1.DataSource = ds; DetailReport1.DataMember = "R1"; LBLSLOT.DataBindings.Add("Text", ds, "R1.SLOT"); LBLMATERIAL_CODE.DataBindings.Add("Text", ds, "R1.MATERIAL_CODE"); LBLDESCRIPTION.DataBindings.Add("Text", ds, "R1.DESCRIPTION"); LBLSTORAGED_LOC.DataBindings.Add("Text", ds, "R1.STORAGED_LOC"); LBLUNIT_QTY.DataBindings.Add("Text", ds, "R1.UNIT_QTY"); LBLFEEDER.DataBindings.Add("Text", ds, "R1.FEEDER_NM"); LBLLOCATION.DataBindings.Add("Text", ds, "R1.MNTNG_LOC_DESC"); //------------------条形码----------------- xrBarCode2.DataBindings.Add("Text", ds, "R1.BARCODE"); //在页脚之后设置分页符 GroupFooter2.PageBreak = PageBreak.AfterBand; }
时间: 2024-10-07 03:41:48