点击回首页
我的浏览记录 | | 帮助?
当前位置:
首页>> 学教实践>> JFZi仓库管理系统源码>> 源文件浏览
[共享版 20分] WinForm,下载次数:65 次 | 关键字: 仓库管理 企业应用 仓储

源码截图

源码目录树

;
当前路径:GridPrinter.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CamtasiaStudio
{
    using System;
    using System.Text;
    using System.Collections;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Drawing.Printing;
    using System.Data;
    using System.Windows.Forms;



    public class GridPrinter
    {
        // the grid to print
        private DataGridView dataGridView;

        // the PrintDocument
        private PrintDocument printDocument;

        // center printout?
        private bool centerOnPage;

        // has a title?
        private bool hasTitle;

        // title
        private string title;

        // font
        private Font titleFont;

        // title color
        private Color titleColor;

        // use paging?
        private bool paging;

        // row printing
        static int currentRow;

        // page printing
        static int pageNumber;

        // page width
        private int pageWidth;

        // page height
        private int pageHeight;

        // left margin
        private int leftMargin;

        // top margin
        private int topMargin;

        // right margin
        private int rightMargin;

        // bottom margin
        private int bottomMargin;

        // y location placeholder
        private float currentY;

        // grid sizes
        private float rowHeaderHeight;
        private List<float> rowsHeight;
        private List<float> columnsWidth;
        private float dataGridViewWidth;

        // column stop points
        private List<int[]> mColumnPoints;
        private List<float> mColumnPointsWidth;
        private int mColumnPoint;

        public GridPrinter(DataGridView objDataGridView, PrintDocument objPrintDocument, bool bCenterOnPage, bool bHasTitle, string sTitle, Font objTitleFont, Color objTitleColor, bool bPaging)
        {
            dataGridView = objDataGridView;
            printDocument = objPrintDocument;
            centerOnPage = bCenterOnPage;
            hasTitle = bHasTitle;
            title = sTitle;
            titleFont = objTitleFont;
            titleColor = objTitleColor;
            paging = bPaging;

            pageNumber = 0;

            rowsHeight = new List<float>();
            columnsWidth = new List<float>();

            mColumnPoints = new List<int[]>();
            mColumnPointsWidth = new List<float>();

            if (!printDocument.DefaultPageSettings.Landscape)
            {
                pageWidth = printDocument.DefaultPageSettings.PaperSize.Width;
                pageHeight = printDocument.DefaultPageSettings.PaperSize.Height;
            }
            else
            {
                pageHeight = printDocument.DefaultPageSettings.PaperSize.Width;
                pageWidth = printDocument.DefaultPageSettings.PaperSize.Height;
            }

            leftMargin = printDocument.DefaultPageSettings.Margins.Left;
            topMargin = printDocument.DefaultPageSettings.Margins.Top;
            rightMargin = printDocument.DefaultPageSettings.Margins.Right;
            bottomMargin = printDocument.DefaultPageSettings.Margins.Bottom;

            currentRow = 0;
        }

        // calculate pri...
完整源码文件,请先购买后再查看
关于我们 | 顾问团队 | 发展历程 | 联系我们 | 源码上传
联系电话(Tel):4008-010-151(免长途)
地址:北京市海淀区大恒科技大厦五层 邮编:100080
Floor 5th,Daheng Building,Zhongguancun,Beijing,China,100080
51Aspx.com 版权所有 CopyRight © 2006-2022. 京ICP备09089570号 | 京公网安备11010702000869号