POS打印

       /// <summary>
        /// 结单打印
        /// </summary>
        /// <param name="strPrintAddress">打印机地址</param>
        /// <param name="dtlPara">打印列表</param>
        /// <param name="strLiterName">操作员</param>
        /// <param name="strTableName">餐桌名称</param>
        /// <param name="dtmOrderStart">开台时间</param>
        /// <param name="strCurrency">货币符号</param>
        /// <param name="strReportTitle">主标题</param>
        /// <param name="strReportNeextTitle">副标题</param>
        /// <param name="strReportEnd">报表主页尾</param>
        /// <param name="strReportNextEnd">报表副页尾</param>
        /// <param name="dblTotolMoney">消费总额</param>
        /// <param name="decActualMoney">实付金额</param>
        /// <param name="decPaidlMoney">已付金额</param>
        /// <param name="dblPayAmount">应收金额</param>
        /// <param name="decMemberDiscount">优惠金额</param>
        /// <param name="strCardNo">结单编号</param>
        /// <param name="intPrintNo">打印份数</param>
        /// <param name="bolIsCurryOut">是否外卖</param>
        /// <param name="bolIsStaffCost">是否员工补单</param>
        /// <param name="dtmOrderEnd"></param>
        /// <param name="divisionID">公司ID</param>
        /// <param name="decMiniCharge">最低消费金额</param>
        public void PrintOrderEnd(DataTable dtlPara, string strPrintAddress, string strLiterName, string strTableName, string dtmOrderStart, string strCurrency, string strReportTitle, string strReportNeextTitle, string strReportEnd, string strReportNextEnd, decimal dblTotolMoney, decimal decActualMoney, decimal decPaidlMoney, decimal dblPayAmount, decimal decMemberDiscount, string strCardNo, int intPrintNo, bool bolIsCurryOut, bool bolIsStaffCost, DateTime dtmOrderEnd, Guid divisionID, decimal decMiniCharge, string strNameTable)
        {
            UserConfig userConfig = new UserConfig();
            string strValue = "";

            _divisionID = divisionID;
            _enumPrintPos = PrintPosEnum.OrderEnd;
            _dtlPara = dtlPara;
            _strLiterName = strLiterName;
            _strTableName = strTableName;
            _dtmOrderStart = dtmOrderStart;
            _strCurrency = strCurrency;
            _strReportTitle = strReportTitle;
            _strReportNextTitle = strReportNeextTitle;
            _strReportEnd = strReportEnd;
            _strReportNextEnd = strReportNextEnd;
            _decTotalMoney = dblTotolMoney;
            _decActualMoney = decActualMoney;
            _decPaidlMoney = decPaidlMoney;
            _decPayAmount = dblPayAmount;
            _decMemberDiscount = decMemberDiscount;
            _strCardNo = strCardNo;
            _intPrintNo = intPrintNo;
            _bolIsCurryOut = bolIsCurryOut;
            _bolIsStaffCost = bolIsStaffCost;
            _dtmOrderEnd = dtmOrderEnd;
            _decMiniCharge = decMiniCharge;
            _strNameTable = strNameTable;

            strValue = userConfig.GetUserConfigValue(EnumUserConfig.cmbMoneyPrintBreadth.ToString(), _divisionID);
            fltFontWidth = float.Parse(strValue);
            if (fltFontWidth == 12)
            {
                intNameNum = 5;
            }
            else if (fltFontWidth == 15)
            {
                intNameNum = 8;
            }

            strValue = userConfig.GetUserConfigValue(EnumUserConfig.txtMoneyPrintShare.ToString(), _divisionID);
            printDocument.DefaultPageSettings.PrinterSettings.Copies = short.Parse(strValue);
            printDocument.DefaultPageSettings.PrinterSettings.Collate = true;

            strValue = userConfig.GetUserConfigValue(EnumUserConfig.cmbMoneyPrint.ToString(), _divisionID);
            printDocument.PrinterSettings.PrinterName = strValue;
            printFont = new Font("宋体", 10);
            printDocument.DefaultPageSettings.Margins.Left = 0;
            printDocument.DefaultPageSettings.Margins.Right = 0;
            printDocument.DefaultPageSettings.Margins.Top = 0;
            printDocument.DefaultPageSettings.Margins.Bottom = 0;
            //不弹出“正在打印”对话框窗口
            printDocument.PrintController = new StandardPrintController();
            //printDocument.DefaultPageSettings.PaperSize = new PaperSize("570*2570",570,2570);

            printDocument.PrintPage += new PrintPageEventHandler(printDocument_PrintPage);
            printDocument.Print();
        }

        private void printDocument_PrintPage(object sender, PrintPageEventArgs e)
        {
            DataView dv = _dtlPara.DefaultView;
            dv.Sort = "hrscQuantity DESC";
            _dtlPara = dv.ToTable();

            Graphics g = e.Graphics;
            float fltYPos = 0; //每一行的Y坐标
            float fltXPos = 0; //每一行的X坐标
            float fltLeftMargin = e.MarginBounds.Left;//获取打印起始位置
            float fltTopMargin = e.MarginBounds.Top;

            if (_enumPrintPos == PrintPosEnum.OrderStart || _enumPrintPos == PrintPosEnum.OrderStartSidePrint || _enumPrintPos == PrintPosEnum.OrderStartTablePrint || _enumPrintPos== PrintPosEnum.OrderHurry)
            {
                #region 表头部分
                //=======================表头部分===================================//
                StringFormat stringFormat = new StringFormat();
                stringFormat.Alignment = StringAlignment.Center;
                fltXPos = fltLeftMargin;
                fltYPos = fltTopMargin;
                Font titleFont = new Font("宋体", 12, FontStyle.Bold);
               
                RectangleF rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, titleFont.GetHeight(e.Graphics));

                if (_enumPrintPos == PrintPosEnum.OrderHurry)
                {
                    g.DrawString("催菜", titleFont, Brushes.Black, rec, stringFormat);
                    stringFormat.Alignment = StringAlignment.Near;

                    fltYPos += 2 * printFont.GetHeight(e.Graphics);
                    rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                    g.DrawString("餐桌名称:" + _strTableName, printFont, Brushes.Black, rec, stringFormat);

                    fltYPos += printFont.GetHeight(e.Graphics);
                    rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                    g.DrawString("餐桌卡号:" + _strTableCardNo, printFont, Brushes.Black, rec, stringFormat);

                    fltYPos += printFont.GetHeight(e.Graphics);
                    rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                    g.DrawString("开台时间:" + _dtmOrderStart, printFont, Brushes.Black, rec, stringFormat);

                }
                else if (_bolIsCurryOut)
                {
                    g.DrawString("外卖", titleFont, Brushes.Black, rec, stringFormat);
                    stringFormat.Alignment = StringAlignment.Near;

                    fltYPos += 2 * printFont.GetHeight(e.Graphics);
                    rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                    g.DrawString("外卖卡号:" + _strTableCardNo, printFont, Brushes.Black, rec, stringFormat);
                }
                else
                {
                    stringFormat.Alignment = StringAlignment.Near;
                    g.DrawString("餐桌名称:" + _strTableName, printFont, Brushes.Black, rec, stringFormat);

                    fltYPos += printFont.GetHeight(e.Graphics);
                    rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                    g.DrawString("餐桌卡号:" + _strTableCardNo, printFont, Brushes.Black, rec, stringFormat);

                    fltYPos += printFont.GetHeight(e.Graphics);
                    rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                    g.DrawString("开台时间:" + _dtmOrderStart, printFont, Brushes.Black, rec, stringFormat);
                }

                fltYPos += printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                g.DrawString("--------------------------------------", printFont, Brushes.Black, rec, stringFormat);

                fltYPos += printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, 80, printFont.GetHeight(e.Graphics));
                if (_enumPrintPos == PrintPosEnum.OrderStartTablePrint)
                {
                    g.DrawString("   菜品名称", printFont, Brushes.Black, rec, stringFormat);
                }
                else
                {
                    g.DrawString("菜品名称", printFont, Brushes.Black, rec, stringFormat);
                }

                fltXPos += fltFontWidth * 10.6f;
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width - 60, printFont.GetHeight(e.Graphics));
                g.DrawString("数量", printFont, Brushes.Black, rec, stringFormat);

                fltXPos += fltFontWidth * 3f;
                rec = new RectangleF(fltXPos, fltYPos, 60, printFont.GetHeight(e.Graphics));
                g.DrawString("口味", printFont, Brushes.Black, rec, stringFormat);

                #endregion

                #region 表体部分
                //==============================表体部分===========================
                for (int i = 0; i < _dtlPara.Rows.Count; i++)
                {
                    fltXPos = fltLeftMargin;
                    fltYPos += printFont.GetHeight(e.Graphics);

                    string str = "";
                    string str1 = "";
                    if (_enumPrintPos == PrintPosEnum.OrderStartTablePrint)
                    {
                        str = "□ " + _dtlPara.Rows[i]["hrspName"].ToString();
                    }
                    else
                    {
                        str = _dtlPara.Rows[i]["hrspName"].ToString();
                    }
                    if (str.Length > intNameNum)
                    {
                        str1 = str.Substring(intNameNum);
                        str = str.Substring(0, intNameNum);
                        rec = new RectangleF(fltXPos, fltYPos, 160, printFont.GetHeight(e.Graphics));
                        g.DrawString(str, printFont, Brushes.Black, rec, stringFormat);
                        fltYPos += printFont.GetHeight(e.Graphics);
                        rec = new RectangleF(fltXPos, fltYPos, 160, printFont.GetHeight(e.Graphics));
                        g.DrawString(str1, printFont, Brushes.Black, rec, stringFormat);
                    }
                    else
                    {
                        rec = new RectangleF(fltXPos, fltYPos, 160, printFont.GetHeight(e.Graphics));
                        g.DrawString(str, printFont, Brushes.Black, rec, stringFormat);
                    }

                    fltXPos += fltFontWidth * 11f;
                    rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width - 60, printFont.GetHeight(e.Graphics));
                    g.DrawString(_dtlPara.Rows[i]["hrscQuantity"].ToString(), printFont, Brushes.Black, rec, stringFormat);

                    fltXPos += fltFontWidth * 2.6f;

                    string strRemark = _dtlPara.Rows[i]["hrfvFlavorRemark"].ToString();
                    string strRemark1 = "";
                    if (strRemark.Length > intRemarkNum)
                    {
                        strRemark1 = strRemark.Substring(intRemarkNum);
                        strRemark = strRemark.Substring(0, intRemarkNum);
                        rec = new RectangleF(fltXPos, fltYPos, 120, printFont.GetHeight(e.Graphics));
                        g.DrawString(strRemark, printFont, Brushes.Black, rec, stringFormat);
                        fltYPos += printFont.GetHeight(e.Graphics);
                        rec = new RectangleF(fltXPos, fltYPos, 120, printFont.GetHeight(e.Graphics));
                        g.DrawString(strRemark1, printFont, Brushes.Black, rec, stringFormat);
                    }
                    else
                    {
                        rec = new RectangleF(fltXPos, fltYPos, 120, printFont.GetHeight(e.Graphics));
                        g.DrawString(strRemark, printFont, Brushes.Black, rec, stringFormat);
                    }

                    //rec = new RectangleF(fltXPos, fltYPos, 120, printFont.GetHeight(e.Graphics));
                    //g.DrawString(_dtlPara.Rows[i]["hrfvFlavorRemark"].ToString(), printFont, Brushes.Black, rec, stringFormat);
                }
                #endregion

                #region 表尾部分
                //===============表尾部分=========================
                fltXPos = fltLeftMargin;
                fltYPos += printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                g.DrawString("--------------------------------------", printFont, Brushes.Black, rec, stringFormat);

                fltYPos += printFont.GetHeight(e.Graphics);
                fltXPos = fltLeftMargin;
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                g.DrawString("操作员:  " + _strLiterName, printFont, Brushes.Black, rec, stringFormat);

                fltXPos = fltLeftMargin;
                fltYPos += printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                g.DrawString("打印时间:" + _dtmPrintTime.ToString(), printFont, Brushes.Black, rec, stringFormat);

                #endregion
            }
            else if (_enumPrintPos == PrintPosEnum.OrderEnd)
            {
                #region 表头部分
                Font titleFont = new Font("宋体", 12, FontStyle.Bold);
                Font headFont = new Font("宋体", 10, FontStyle.Bold);
                StringFormat stringFormat = new StringFormat();
                stringFormat.Alignment = StringAlignment.Center;
                fltXPos = fltLeftMargin;
                fltYPos = fltTopMargin;
                RectangleF rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, titleFont.GetHeight(e.Graphics));
                g.DrawString(_strReportTitle, titleFont, Brushes.Black, rec, stringFormat);

                fltYPos += printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, titleFont.GetHeight(e.Graphics));
                g.DrawString(_strReportNextTitle, headFont, Brushes.Black, rec, stringFormat);

                stringFormat.Alignment = StringAlignment.Near;
                fltYPos += 2 * printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                if (_bolIsCurryOut)
                {
                    g.DrawString("外卖", printFont, Brushes.Black, rec, stringFormat);
                }
                else if (_bolIsStaffCost)
                {
                    g.DrawString("员工补单", printFont, Brushes.Black, rec, stringFormat);
                    fltYPos += printFont.GetHeight(e.Graphics);
                    rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                    g.DrawString("补单时间:" + DateTime.Parse(_dtlPara.Rows[0]["hrcsStartDate"].ToString()).ToString(), printFont, Brushes.Black, rec, stringFormat);

                }
                else
                {
                    g.DrawString("餐桌名称:" + _dtlPara.Rows[0]["hrtsName"].ToString() + _strNameTable, printFont, Brushes.Black, rec, stringFormat);
                    if (_decMiniCharge > 0)
                    {
                        fltYPos += printFont.GetHeight(e.Graphics);
                        rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                        g.DrawString("最低消费:" + _strCurrency + Math.Round(Convert.ToDecimal(_decMiniCharge), 2).ToString(), printFont, Brushes.Black, rec, stringFormat);
                    }
                    fltYPos += printFont.GetHeight(e.Graphics);
                    rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                    g.DrawString("开台时间:" + DateTime.Parse(_dtlPara.Rows[0]["hrcsStartDate"].ToString()).ToString(), printFont, Brushes.Black, rec, stringFormat);

                }

                fltYPos += printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                g.DrawString("=======================================", printFont, Brushes.Black, rec, stringFormat);

                fltYPos += printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, 80, printFont.GetHeight(e.Graphics));
                g.DrawString("菜品名称", printFont, Brushes.Black, rec, stringFormat);

                fltXPos += fltFontWidth * 8f;
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width - 60, printFont.GetHeight(e.Graphics));
                g.DrawString("数量", printFont, Brushes.Black, rec, stringFormat);

                fltXPos += fltFontWidth * 3.3f;
                rec = new RectangleF(fltXPos, fltYPos, 60, printFont.GetHeight(e.Graphics));
                g.DrawString("单价", printFont, Brushes.Black, rec, stringFormat);

                fltXPos += fltFontWidth * 4f;
                rec = new RectangleF(fltXPos, fltYPos, 60, printFont.GetHeight(e.Graphics));
                g.DrawString("小计", printFont, Brushes.Black, rec, stringFormat);

                #endregion

                #region 表体部分
                for (int j = 0; j < _dtlPara.Rows.Count; j++)
                {
                    fltXPos = fltLeftMargin;
                    fltYPos += printFont.GetHeight(e.Graphics);
                    string str = _dtlPara.Rows[j]["hrspName"].ToString();
                    string str1 = "";
                    if (str.Length > intNameNum)
                    {
                        str1 = str.Substring(intNameNum);
                        str = str.Substring(0, intNameNum);
                        rec = new RectangleF(fltXPos, fltYPos, 160, printFont.GetHeight(e.Graphics));
                        g.DrawString(str, printFont, Brushes.Black, rec, stringFormat);
                        fltYPos += printFont.GetHeight(e.Graphics);
                        rec = new RectangleF(fltXPos, fltYPos, 160, printFont.GetHeight(e.Graphics));
                        g.DrawString(str1, printFont, Brushes.Black, rec, stringFormat);
                    }
                    else
                    {
                        rec = new RectangleF(fltXPos, fltYPos, 160, printFont.GetHeight(e.Graphics));
                        g.DrawString(str, printFont, Brushes.Black, rec, stringFormat);
                    }

                    fltXPos += fltFontWidth * 8f;
                    rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width - 60, printFont.GetHeight(e.Graphics));
                    g.DrawString(_dtlPara.Rows[j]["hrscQuantity"].ToString(), printFont, Brushes.Black, rec, stringFormat);

                    fltXPos += fltFontWidth * 2.6f;
                    rec = new RectangleF(fltXPos, fltYPos, 85, printFont.GetHeight(e.Graphics));
                    g.DrawString(_strCurrency + Math.Round(Convert.ToDecimal(_dtlPara.Rows[j]["hrscdRealPrice"]) + 0.00m, 2).ToString(), printFont, Brushes.Black, rec, stringFormat);

                    fltXPos += fltFontWidth * 3.6f;
                    rec = new RectangleF(fltXPos, fltYPos, 85, printFont.GetHeight(e.Graphics));
                    g.DrawString(_strCurrency + Math.Round(Convert.ToDecimal(_dtlPara.Rows[j]["hrscdAmount"]) + 0.00m, 2).ToString(), printFont, Brushes.Black, rec, stringFormat);
                }
                #endregion

                #region 表尾部分
                fltXPos = fltLeftMargin;
                fltYPos += printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                g.DrawString("---------------------------------------", printFont, Brushes.Black, rec, stringFormat);

                fltXPos = fltLeftMargin;
                fltYPos += 2 * printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                g.DrawString("应付金额:" + _strCurrency + Math.Round(_decActualMoney + _decMemberDiscount + 0.00m, 2), printFont, Brushes.Black, rec, stringFormat);
               
                fltXPos += fltFontWidth * 10f;
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                g.DrawString("实付金额:" + _strCurrency + Math.Round(_decActualMoney + 0.00m, 2), printFont, Brushes.Black, rec, stringFormat);

                fltXPos = fltLeftMargin;
                fltYPos += printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                g.DrawString("已付金额:" + _strCurrency + Math.Round(_decPayAmount + 0.00m, 2), printFont, Brushes.Black, rec, stringFormat);

                fltXPos = fltLeftMargin;
                fltYPos += printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                g.DrawString("优惠金额:" + _strCurrency + Math.Round(_decMemberDiscount + 0.00m, 2), printFont, Brushes.Black, rec, stringFormat);

                fltXPos += fltFontWidth * 10f;
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                if (_decActualMoney > 0 && _decPayAmount <= 0)
                {
                    g.DrawString("挂单金额:" + _strCurrency + Math.Round(_decTotalMoney + 0.00m, 2), printFont, Brushes.Black, rec, stringFormat);
                }
                else
                {
                    g.DrawString("找零金额:" + _strCurrency + Math.Round((_decPayAmount - _decTotalMoney) + 0.00m, 2), printFont, Brushes.Black, rec, stringFormat);
                }
                if (_intPrintNo > 1)
                {

                    fltXPos = fltLeftMargin;
                    fltYPos += printFont.GetHeight(e.Graphics);
                    rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                    g.DrawString("该单金额:" + _strCurrency + Math.Round((_decActualMoney / _intPrintNo) + 0.00m, 2), printFont, Brushes.Black, rec, stringFormat);
                }
                fltXPos = fltLeftMargin;
                fltYPos += printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                g.DrawString("结单编号:" + _strCardNo, printFont, Brushes.Black, rec, stringFormat);

                fltXPos = fltLeftMargin;
                fltYPos += printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                g.DrawString("操作员:" + _strLiterName, printFont, Brushes.Black, rec, stringFormat);

                fltXPos = fltLeftMargin;
                fltYPos += printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                g.DrawString("结单时间:" + _dtmOrderEnd.ToString(), printFont, Brushes.Black, rec, stringFormat);

                stringFormat.Alignment = StringAlignment.Center;
                fltYPos += 2 * printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                g.DrawString(_strReportEnd, printFont, Brushes.Black, rec, stringFormat);

                fltYPos += printFont.GetHeight(e.Graphics);
                rec = new RectangleF(fltXPos, fltYPos, printDocument.DefaultPageSettings.PaperSize.Width, printFont.GetHeight(e.Graphics));
                g.DrawString(_strReportNextEnd, printFont, Brushes.Black, rec, stringFormat);
                #endregion
            }

            e.HasMorePages = false;
        }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值