• 预览打印


      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
  • 相关阅读:
    JSON.stringify() & JSON.parse() 实现
    节流(Throttling) & 防抖(Debouncing)
    instanceof实现
    new实现
    如何实现深拷贝
    #FFF转换为rgba(255,255,255,1)
    hdcms v5.7.0学习笔记
    Laravel5.x 封装的上传图片类
    JQ 封装全选函数
    双击 ajax修改单元格里的值
  • 原文地址:https://www.cnblogs.com/tiancaige/p/14784890.html
Copyright © 2020-2023  润新知