在 VB.Net 中为 rdlc 报告设置打印机纸张大小 [英] Setting printer paper size in VB.Net for rdlc report

查看:63
本文介绍了在 VB.Net 中为 rdlc 报告设置打印机纸张大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用VB.net 2010做了一个横向的报表,制作尺寸为16.5 cm * 8.25 cm

打印报表时直接显示A4页面大小!!!

我需要为打印机提供自定义纸张尺寸.如何使我的报告具有自定义纸张尺寸?

链接:

I built a report with a landscape orientation using VB.net 2010 and made the ​​size 16.5 cm * 8.25 cm

When you print the report directly shows the size of the page A4 !!!

I need to provide the printer with a custom paper size. How can I make my report have a custom paper size?

Link: http://www.uploadmb.com/dw.php?id=1379145264

解决方案

In order to change the default format (A4) of a report, you must change the report properties to accept a custom paper size.

Set PaperSize By GUI

Step 1

Open your report and right click (on the gray pane, not the report itself) to select "Report Properties"

Step 2

Choose Landscape for your orientation and select a custom paper size. Specify your width and height as well.


Programmatically Set PaperSize

  1. Paper Size should be the size in inches multiplied by 100
  2. Width: The width of the paper, in hundredths of an inch
  3. Height: The height of the paper, in hundredths of an inch

Here is the code I used to programmatically set a custom paper size to my report

ReportViewer1.PrinterSettings.DefaultPageSettings.PaperSize = new PaperSize("Custom", 650, 325)

**Note: Don't forget, you may need to use the code ReportViewer1.RefreshReport() if it doesn't work.*

For more information, visit MSDN's PaperSettings.PaperSize page

这篇关于在 VB.Net 中为 rdlc 报告设置打印机纸张大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆