zoukankan      html  css  js  c++  java
  • 20180519001

    DataSet6 = DataSet1.Copy();

    DataRow[] dr = DataSet6.Tables[0].Select(" 完工状态 = '完工异常' ");

    DataTable dt1 = DataSet6.Tables[0].Clone();

    for (int i = 0; i < dr.Length; i++)
    {
    dt1.ImportRow((DataRow)dr[i]);

    //this.Text = i.ToString();
    }

    // Group by
    DataTable dtResult = dt1.Clone();
    DataTable dtName = dt1.DefaultView.ToTable(true, "委外发票号", "委外订单号", "存货编码", "工艺名称", "订单数量", "出库数量", "未交数量", "CT不良数", "原币含税单价",
    "原币价税合计", "累计开票金额", "币种");
    for (int i = 0; i < dtName.Rows.Count; i++)
    {
    DataRow[] rows = dt1.Select(" 委外发票号 ='" + dtName.Rows[i]["委外发票号"].ToString()
    + "' and 委外订单号='" + dtName.Rows[i]["委外订单号"].ToString()
    + "' and 存货编码='" + dtName.Rows[i]["存货编码"].ToString()
    + "' and 工艺名称='" + dtName.Rows[i]["工艺名称"].ToString() + "' ");
    //temp用来存储筛选出来的数据
    DataTable temp = dtResult.Clone();
    foreach (DataRow row in rows)
    {
    temp.Rows.Add(row.ItemArray);
    }

    DataRow dr2 = dtResult.NewRow();
    dr2["委外发票号"] = dtName.Rows[i]["委外发票号"].ToString();
    dr2["委外订单号"] = dtName.Rows[i]["委外订单号"].ToString();
    dr2["存货编码"] = dtName.Rows[i]["存货编码"].ToString();
    dr2["工艺名称"] = dtName.Rows[i]["工艺名称"].ToString();
    dr2["订单数量"] = dtName.Rows[i]["订单数量"].ToString();
    dr2["出库数量"] = dtName.Rows[i]["出库数量"].ToString();
    dr2["未交数量"] = dtName.Rows[i]["未交数量"].ToString();
    dr2["CT不良数"] = dtName.Rows[i]["长腾不良数"].ToString();
    dr2["原币含税单价"] = dtName.Rows[i]["原币含税单价"].ToString();
    dr2["原币价税合计"] = dtName.Rows[i]["原币价税合计"].ToString();
    dr2["累计开票金额"] = dtName.Rows[i]["累计开票金额"].ToString();

    dr2["币种"] = dtName.Rows[i]["币种"].ToString();

    dr2["入库数量"] = temp.Compute("sum(入库数量)", "");
    dtResult.Rows.Add(dr2);
    }


    //
    DataSet9 = new DataSet();
    DataSet9.Tables.Add(dtResult);

  • 相关阅读:
    PHP 统计数据功能 有感
    一个高效的工作方式
    Navicat for mysql 导出sql文件 导入sql文件
    chrome浏览器,调试详解,调试js、调试php、调试ajax
    网络编程中几个地址结构与转换(in_addr,sockaddr,sockaddr_in,pcap_addr)
    TCP 协议
    tcp抓包 Wireshark 使用
    (转)linux中常用的头文件
    ubuntu安装使用kdevelop
    安卓u8800刷机
  • 原文地址:https://www.cnblogs.com/hutie1980/p/9059911.html
Copyright © 2011-2022 走看看