简体   繁体   中英

How to print Client Report Definition file (.rdlc) on A4 size in C#?

I am trying to print a report using C# Report Viewer Control.

By the way, I bumped into a problem.

I wanted my .rdlc file to be printed on A4 size. so I changed .rdlc file size with A4 size 210X297(mm) in the VS2010 designer . But the report viewer object that uses this .rdlc file automatically sets the margins on the paper. So the total size of the paper that will be printed was over A4 size.

I can't estimate the size of the margin. Is there any way to estimate or control the size of the margin?

I have been searching for the last some days... I need help. please give me a hand.

My platform is VS2010 / .Net 4.0 / C#


Thanks tezzo for your help. I appriciate it. My problem was which I didn't know the fact that Report > Report properties > Page setup exists. I could resolve my problem by your advice. But I had what makes me confused. so I leave some aditional pictures. I hope it is helpful to another person who encounters such a problem.

  1. You have to click the point that the picture 1 expresses by the check sign. If you click the point that the picture 2 expresses by the check sign, you can not see such a properties window that have a Margins and a PageSize Property, which makes me confused.

When you reach here, you can follow tezzo's advice. then you can print rdlc file on A4 size.

I am first to write here. so I can't add any picture on it. I link pictures.

< picture 1>

在此处输入图片说明

< picture 2 >

在此处输入图片说明

You can set paper size and margins in Report > Report properties > Page setup .

I usually use this settings:

  • paper size: A4
  • size: 21 x 29,7 (landscape: 29,7 x 21)
  • left/right margin: 1,3cm
  • bottom/top margins: 1,5cm

So the maximum width of report will be:

  • 21 - (1,3*2) = 18,4cm
  • 29,7 - (1,3*2) = 27,1cm (landscape)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM