C# REPORTVIEWER控件 RDLC 打印二等分连续纸配置

 //初始化页面
            PaperSize p = null;
            //初始化设置
            PageSettings ps = new PageSettings(); 
            //默认纸张 纸张 宽 高
            p = new PaperSize("金盾打印", (int)(241 / 25.4 * 100), (int)(139.7 / 25.4 * 100));
            //默认边距
            Margins ma = new Margins((int)(30 / 25.4 * 100), (int)(10 / 25.4 * 100), (int)(5 / 25.4 * 100), (int)(0 / 25.4 * 100));
            PrinterSettings pt = new PrinterSettings();
            
            //如果系统打印机有纸张,按系统打印配置
            PrintDocument pd = new PrintDocument();
            foreach (PaperSize py in pd.PrinterSettings.PaperSizes)
            {
                if (py.PaperName.Contains("二等分"))
                    p = py;
            }

            //设置
            ps.Margins = ma;
            ps.PaperSize = p; 
             
            reportViewer1.SetPageSettings(ps);

             
            //设置打印布局模式,显示物理页面大小
            this.reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
            //缩放模式为百分比,以100%方式显示
            this.reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.PageWidth;
            this.reportViewer1.ZoomPercent = 100;

            this.reportViewer1.RefreshReport();

网上相关资料很少,记录一下! 以上配置测试可行

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值