提供一个DataGrid的打印类

作者:袖梨 2022-07-02
namespace AsterDnet
{
    using System;
    using System.ComponentModel;
    using System.Windows.Forms;
    using System.Drawing;
    using System.Drawing.Printing;
    using System.IO;
    using System.Data ;
    using System.Data.SqlClient ;
    
    ///
    /// 打印DataGrid中的数据到打印机
    ///
    ///

    public class DataGridPrintDocument : PrintDocument
    {
        //打印字体
        private Font printFont = null;
        private DataTable dt=null;
        //当前页码
        private int currentPageNumber=1;
        //是否打印页码
        private bool isPrintPageNumber=false;
        public bool IsPrintPageNumber
        {
       get
       {
           return this.isPrintPageNumber ;

相关文章

精彩推荐