zoukankan      html  css  js  c++  java
  • 打印grid

    void PrintButtonClick(object sender, EventArgs e)
            {
                PrintPreviewDialog dlg = new PrintPreviewDialog();
                
                //page setting 
                PageSetupDialog psp = new PageSetupDialog();
                psp.AllowMargins = true;
                SourceGrid.Exporter.GridPrintDocument pd = new SourceGrid.Exporter.GridPrintDocument(this.grid);
    
                //页边距开关 若关闭:打印时页边距设置无效、不起作用的原因及解决方法
                pd.OriginAtMargins = true;
                //是否 横向打印
                pd.DefaultPageSettings.Landscape = true;
                //左边距 左边距宽度(以百分之一英寸为单位)
                pd.DefaultPageSettings.Margins.Left = 210;
                psp.PageSettings = pd.DefaultPageSettings;
                //显示 英寸还是毫米
                psp.EnableMetric = true;
    
                if (psp.ShowDialog() == DialogResult.OK)
                {
                    pd.DefaultPageSettings = psp.PageSettings;
                }
    
                
                pd.RangeToPrint = new SourceGrid.Range(0, 0, this.grid.Rows.Count - 1, this.grid.Columns.Count - 1);
                pd.PageHeaderText = "Print sample		SourceGrid print document sample";
                pd.PageTitleText = "	Sample grid";
                pd.PageFooterText = "	Page [PageNo] from [PageCount]";
                dlg.Document = pd;
                dlg.ShowDialog(this);
            }
  • 相关阅读:
    springboot设置请求超时
    Dockerfile 中 ENTRYPOINT 与 CMD 的区别
    iptables
    git commit statistics
    query spring mongo limit or skip test
    创建证书
    Linux基本网络配置
    k8s
    iis express添加网站,并启动
    用cmd的方式执行exe程序
  • 原文地址:https://www.cnblogs.com/zeroone/p/3306162.html
Copyright © 2011-2022 走看看