zoukankan      html  css  js  c++  java
  • 报表参数添加

    string sqlWhere = string.Empty;
    string sqlWhere2 = string.Empty;
    if (!string.IsNullOrEmpty(textBox2.Text))
    {
    sqlWhere += " and pick_doc like '%" + textBox2.Text + "%'";
    }
    if (!string.IsNullOrEmpty(textBox4.Text))
    {
    sqlWhere2 += " and material_name like '%" + textBox4.Text + "%'";
    }
    sqlWhere += "and date_delivery>='" + Convert.ToDateTime(dateTimePicker1.Text).ToString("yyyy-MM-dd")
    + "' and date_delivery<='" + Convert.ToDateTime(dateTimePicker2.Text).ToString("yyyy-MM-dd") + "'";
    #region QQS020M
    string sql = @"select id,pick_doc,date_delivery,status,memo,org from QQS020M where 1=1" + sqlWhere;
    this.dt1 = Program.DB.GetDataTable(sql);
    try
    {
    this.dataSet检货.Tables[1].Rows.Clear();
    for (int i = 0; i < dt1.Rows.Count; i++)
    {
    DataRow DR = dataSet检货.Tables[1].NewRow();
    DataRow dr = dt1.Rows[i];
    DR["表ID"] = (i + 1);
    DR["检货计划单"] = dr["pick_doc"];
    DR["检货日期"] = dr["date_delivery"];
    DR["状态"] = dr["status"];
    DR["备注"] = dr["memo"];
    DR["组织"] = dr["org"];
    dataSet检货.Tables[1].Rows.Add(DR);
    }
    ReportParameter[] ps1 = new ReportParameter[3];// ("条件", ReturnData[0]);
    ps1[0] = new ReportParameter("总行数", dt1.Rows.Count.ToString());
    ps1[1] = new ReportParameter("制表人", Program.User);
    ps1[2] = new ReportParameter("制表日期",DateTime.Now.ToString("yyyy-MM-dd"));
    this.reportViewer1.LocalReport.SetParameters(ps1);

    this.reportViewer1.RefreshReport();
    }
    catch (Exception)
    {

    throw;
    }
    #endregion

  • 相关阅读:
    扩展运算符(Spread operator)
    增强的对象字面量,解构赋值
    ES6 模板字符串(template string)
    let和const
    svg实现放大效果
    svg制作风车旋转
    jquery实现某宝放大点击切换
    jQuery之文档处理
    jQuery之属性操作
    jQuery css操作
  • 原文地址:https://www.cnblogs.com/jasonch123/p/9190431.html
Copyright © 2011-2022 走看看