• 预览打印


      Print("preview");

    查询页面:

            private void Print(string printOrpreview)
            {
                DevExpress.XtraGrid.Views.Grid.GridView gridview = this.HwInInvGridView;
                int[] rows = gridview.GetSelectedRows();
                if (rows.Length <= 0)
                {
                    MessageBox.Show("请选中需要打印的内容!", "提示");
                    return;
                }
                string mainid = "";
                for (int i = 0; i < rows.Length; i++)
                {
                    mainid += "'" + gridview.GetRowCellValue(rows[i], "mainid") + "',";
                }
                if (!string.IsNullOrEmpty(mainid))
                {
                    mainid = mainid.Substring(0, mainid.Length - 1);
                }
                //此处 主单id和物料编号共同确定一条选择的的数据
                string sqlcondition = " and ep_FinishedGoodsStockInBase.ep_FinishedGoodsStockInId in (" + mainid + ")";
                #region 预览打印
                string isqueraydata = "1";//是否查数据
                string iswritelog = "0";//是否写入日志
                string fupage = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName;//功能页面
                string buttonname = printOrpreview == "preview" ? buttonname = this.BtnPreview.Text.ToString() : this.BtnPrint.Text.ToString();//预览还是打印按钮
                FormPrintSetUtils.GetDataAndPrint(fupage, buttonname, sqlcondition, isqueraydata, iswritelog, FReport, printOrpreview);//数据集获取,预览还是打印
                #endregion
            }
    View Code

    信息页面:

      private void Print(string printOrpreview)
            {
                string mainid = id;
                if (string.IsNullOrEmpty(mainid))
                {
                    MessageBox.Show("获取信息失败!", "提示");
                    return;
                }
                #region 预览打印
                string sqlcondition = " and ep_hwwarehouseformBase .ep_hwwarehouseformId ='" + mainid + "'";
                string buttonname = printOrpreview == "preview" ? this.BtnPreview.Text.ToString() : this.BtnPrint.Text.ToString();//按钮名
                string fupage = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName;//功能页面
                string isqueraydata = "1";//是否查数据
                string iswritelog = "0";//是否写入日志
                FormPrintSetUtils.GetDataAndPrint(fupage, buttonname, sqlcondition, isqueraydata, iswritelog, FReport, printOrpreview);//数据集获取,预览还是打印
                #endregion
            }
    View Code
  • 相关阅读:
    dev c++ 使用
    PAT A1012 The Best Rank (25分) [排序]
    算法笔记-排序算法
    PAT A1081 Rational Sum (20) [分数的四则运算]
    PAT A1015 Reversible Primes (20分) [素数 质数 进制转换]
    PAT A1078 Hashing (25) [⼆次⽅探查法 素数 质数]
    PAT A1058 A+B in Hogwarts (20)[进制转换]
    PAT 1027 Colors in Mars (20分)
    将博客搬至CSDN
    windows环境下面配置pip环境变量
  • 原文地址:https://www.cnblogs.com/tiancaige/p/14784890.html
Copyright © 2020-2023  润新知