Set report (RDLC) as always landscape printing and 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
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.
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
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
精彩评论