• 大小: 0.06M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-14
  • 语言: C#
  • 标签:

资源简介


我自己写的C#打印DataGridView的完整实例,可以设置多种打印版本式,支持多页打印,打印效果不错,美观,可靠.

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing.Printing;
using System.Windows.Forms;
using System.Drawing;

namespace printerTest
{
    public class DGVPrinter
    {
        PrintDocument printDoc;
        PageSetupDialog pageSetupDlg;
        PrintPreviewDialog previewDlg;
        PrintDialog printDlg;

        DataGridView sourceDGV;
        public DataGridView SourceDGV
        {
            get { return sourceDGV; }
            set { sourceDGV = value; }
        }

        int printedRowsCount=0;
        public Font printFont;

        public string maintitle = ““;
        public string subtitle = ““;
        public DGVPrinter()
        {
            printFont = SystemFonts.DefaultFont;

      

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2010-10-29 23:42  printerTest\
     目录           0  2010-10-29 23:42  printerTest\printerTest\
     文件         923  2010-10-29 23:42  printerTest\printerTest.sln
     文件       17408  2010-11-02 00:21  printerTest\printerTest.suo
     目录           0  2010-10-29 23:42  printerTest\printerTest\bin\
     目录           0  2010-10-29 23:42  printerTest\printerTest\bin\Debug\
     文件        8192  2010-10-30 21:04  printerTest\printerTest\bin\Debug\Drmaple.dll
     文件       13824  2010-11-02 00:21  printerTest\printerTest\bin\Debug\printerTest.exe
     文件       38400  2010-11-02 00:20  printerTest\printerTest\bin\Debug\printerTest.pdb
     文件       14328  2010-11-02 00:21  printerTest\printerTest\bin\Debug\printerTest.vshost.exe
     文件        6913  2010-10-31 11:36  printerTest\printerTest\DgvPrinter.cs
     目录           0  2010-10-29 23:42  printerTest\printerTest\obj\
     目录           0  2010-10-29 23:42  printerTest\printerTest\obj\Debug\
     文件         848  2010-11-02 00:21  printerTest\printerTest\obj\Debug\printerTest.csproj.FileListAbsolute.txt
     文件         913  2010-10-30 21:08  printerTest\printerTest\obj\Debug\printerTest.csproj.GenerateResource.Cache
     文件       13824  2010-11-02 00:21  printerTest\printerTest\obj\Debug\printerTest.exe
     文件       38400  2010-11-02 00:20  printerTest\printerTest\obj\Debug\printerTest.pdb
     文件         180  2010-11-02 00:20  printerTest\printerTest\obj\Debug\printerTest.printTestForm.resources
     文件         180  2010-11-02 00:20  printerTest\printerTest\obj\Debug\printerTest.Properties.Resources.resources
     目录           0  2010-10-30 21:13  printerTest\printerTest\obj\Debug\Refactor\
     文件        6095  2010-11-02 00:10  printerTest\printerTest\obj\Debug\ResolveAssemblyReference.cache
     目录           0  2010-10-29 23:42  printerTest\printerTest\obj\Debug\TempPE\
     文件        3948  2010-11-02 00:20  printerTest\printerTest\printerTest.csproj
     文件        2315  2010-11-02 00:16  printerTest\printerTest\printTestForm.cs
     文件        4413  2010-10-30 21:08  printerTest\printerTest\printTestForm.Designer.cs
     文件        5814  2010-10-30 21:08  printerTest\printerTest\printTestForm.resx
     文件         500  2010-10-30 11:16  printerTest\printerTest\Program.cs
     目录           0  2010-10-29 23:42  printerTest\printerTest\Properties\
     文件        1360  2010-10-29 23:42  printerTest\printerTest\Properties\AssemblyInfo.cs
     文件        2872  2010-10-29 23:42  printerTest\printerTest\Properties\Resources.Designer.cs
     文件        5612  2010-10-29 23:42  printerTest\printerTest\Properties\Resources.resx
............此处省略2个文件信息

评论

共有 条评论