将报告 (RDLC) 设置为始终横向打印和 A4 [英] Set report (RDLC) as always landscape printing and A4

查看:54
本文介绍了将报告 (RDLC) 设置为始终横向打印和 A4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将 RDLC 报告设置为始终为横向并始终使用 A4,而无需每次通过打印对话框手动执行此操作?我已经在这里呆了几个小时,谷歌搜索后没有任何结果.

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

推荐答案

当然可以避开打印对话框直接打印,也可以在代码中指定页面大小和打印方向.我们在我们的项目中这样做,但代码有点混乱,而且它是在 VB 中的,所以我不会在这里发布一大块.

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 有一个标题为 演练:不带预览的打印本地报告的页面.此代码有一些 XML 来设置页面大小:

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>" + _

将此更改为 29.7cm &21cm 适用于 A4 横向.

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

这篇关于将报告 (RDLC) 设置为始终横向打印和 A4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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