zoukankan      html  css  js  c++  java
  • devexpress XtraReport报表 ---主从报表

    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;
        }
    

      

  • 相关阅读:
    (数据挖掘-入门-6)十折交叉验证和K近邻
    (数据挖掘-入门-5)基于内容的协同过滤与分类
    (数据挖掘-入门-4)基于物品的协同过滤
    (数据挖掘-入门-3)基于用户的协同过滤之k近邻
    (数据挖掘-入门-2)相似度衡量的方法
    (数据挖掘-入门-1)基于用户的协同过滤之最近邻
    SDL播放声音
    清空目录
    yuv转bmp
    ffmpeg解码视频流
  • 原文地址:https://www.cnblogs.com/hqyj/p/7426528.html
Copyright © 2011-2022 走看看