Set report (RDLC) as always landscape printing and A4

主宰稳场 提交于 2020-01-12 06:52:10

问题


Is there a way to set an RDLC report to be always Landscape and to always use A4 without the need of manually doing so every time through the print dialog? I've been at this for a few hours and nothing came up after googling.

Indeed, is there a way to skip the print dialog in itself?

TIA


回答1:


You can certainly avoid the print dialog and print directly, also you can specify page size and print orientation in code. We do it in our projects but the code is a bit of muddle plus it's in VB so I won't post a chunk of it here.

MSDN has a page titled Walkthrough: Printing a Local Report without Preview. This code has some XML to set the page size:

      "  <PageWidth>8.5in</PageWidth>" + _
      "  <PageHeight>11in</PageHeight>" + _

Change this to 29.7cm & 21cm for A4 Landscape.




回答2:


As A4 size is 8.3 inches × 11.7 inches(Portrait).

So you need to set it to

report properties>Layout>Set page width and height.

Or you can manually print the report.

Look at this tutorial

Printing RDLC Report manually




回答3:


Double click on your report (ex: report1.rdlc) in Solution Explorer then right click on the report page and select Report Properties and you can select your prefer paper size and orientation as shown below



来源:https://stackoverflow.com/questions/6175299/set-report-rdlc-as-always-landscape-printing-and-a4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!