Home » Visual StudioRSS

Reportviewer Paper size

Is there any way to set the paper size for the Reportviewer control other than at runtime using the Page Setup button.

It always defaults to "Letter" which is not really suitable for all countries.

I am using Visual Studio RC1 on Windows Forms application.

 

34 Answers Found

 

Answer 1

The problem is in RTM version too. Previous threads talk about this, but no solution at all. Waiting for some tips from MS.
 

Answer 2

The default paper  size is set  in the .rdlc file. Here's how you can set the default to Legal:

Open the .rdlc file using Report Designer. Then from the menu choose Report > Report Properties. In Report Properties dialog switch to Layout tab. Set Page Width to 612pt and Page Height to 1008pt. Save the report and run the application. Now when you open the Page Setup dialog in the ReportViewer control the paper size defaults to Legal.
 

Answer 3

Thank you Rajeev. However following on from what you have said, if one sets the size  to 1169pt wide and 827pt high, the default should be A4 landscape. However it still defaults  to Letter.

Please can you shed some more light.
 

Answer 4

I've managed to get it to default to A4, not by altering the rdlc file, but instead setting regional settings in Windows to Swedish. I'd really like a way to force A4 independently of regional settings.
 

Answer 5

In the Report Properties dialog if I set  Page width to 8.27in and Page height to 11.69in then the Page Setup dialog of ReportViewer defaults  to A4.

In the Report Properties dialog if I set Page width to 11.69in and Page height to 8.27in then the Page Setup dialog of ReportViewer defaults to A4, and Orientation defaults to Landscape.
 

Answer 6

Ok, works, thanks.
But here in Italy, if i set  21cm x 29,7cm (which actually means 8.27in x 11.69in but expressed in centimeters) it defaults  to Letter anyway. Not a big problem, i'll use inches, but i'd like to understand what happens undercover.
For now, i assume i'll use only inches sizes.

Moreover i would like to know if i can set page size  at runtime, so the user can decide the page  orientation before launching the reportviewer.

 

Answer 7

Thank you Rajeev. This is a workaround as 27.9cm and 21cm should also work. You have however solved my immediate issue.
 

Answer 8

Francois (and MS), i've tried 21cm x 29,7cm and 29,7cm x 21cm but still defaults  to letter  (using inches, as suggested by MS, it works).
 

Answer 9

I think this might be because the language of your Rdlc (or Rdl) file is set  to English (United States)?

Either set it to Default (meaning Regional settings) or Italian.

Hope this helps.
 

Answer 10

Robert, thanks for the clue but no luck.

I've tried the report language in: "Italian", "Italian (Italy)" and "Default" (i've verified that in my regional settings i have "Metrico decimale" as measurement system), i've setted both "InteractiveSize" and "PageSize" to 21cm x 29,7cm but the pagesize in the reportviewer always defaults  to Letter.

As told before, if i set  the pagesize in inches (8,27in x 11,69in) then the reportviewer  shows the correct "A4" pagesize, this mitigates the problem.
 

Answer 11

It would be nice to get some information from official sources on how all this is supposed to work!
 

Answer 12

 Robert Jeppesen wrote:
It would be nice to get some information from official sources on how all this is supposed to work!


Agreed! Where are you, MS?
 

Answer 13

There is a bug in ReportViewer, caused by a round off error. A fix will likely be made available in a service pack.
 

Answer 14

Thanks for the Information.

Come Service Pack Come Come Come....

 

Answer 15

Note that the bug isn't that the paper  size can't be set  at all.  You will not hit the bug if you specify the paper size  in inches, since no unit conversion is necessary for that case.  The display will still reflect the correct regional settings.
 

Answer 16

Hello ! how to find this rdlc or rdl file. I m using vb.net (vsstudio 2002) framerwork 1.1 and crystal report 9.2

Also facing the same prob.

Regards,

Naimesh Trivedi
nbtrivedi@hotmail.com

 

Answer 17

Just installed the VS 2005 SP1 Beta, and the problem is still here. I've submitted a bug report :

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=217301

Where are you MS ?

 

Answer 18

You can set  the page size  to print in A4 by setting the page  size to A4 (21*29.7). If the page size isn't a standard size it seems to default to letter  in Report Manager.

This is very frustrating as id you set the page width to be a little but larger (say 31 * 29) to fit my report onto one page when printing and for the report to look normal when viewed through RM. When you print preview it'll print to a page (essentially shrinking the report to fit) and exporting it to Adobe it will fit to a page but the default when printing will be letter.

You can obviously change the print properties from Letter to A4 when printing and it will print to a page or export it to Adobe and print from there it but this isn't good enough really.

What we have done now is create small reports that they have to zoom into when using RM.....but they print properly

Viz studio  also has a bug in it. If you look at print preview that's how it might print on when viewed from Report Manager. If you then print from Viz Studio the report will print in Letter

Either that or set you organisation up to us Letter format printing..... and whilst you there change the time format to be mm dd yyyy

 

Answer 19

Anyone have a way to pass the report parameters to set  the Report Properties of paper  size to A4 at execution time?

I have a number of reports that can be run in the US or Int'l and would like to simply determine the correct papersize at run time.

Thank you...

 

Answer 20

We have the same issue, a single UK based SSRS server that handles reports for a global audience.  Very frustrating at the moment...
 

Answer 21

This is so frustrating. I have a problem where I set  my report layout to A4 landscape using inches. This is fine, but when i go to print preview it still displays as letter. if I click on the patge setup  icon, the page size  displays in the

pick list as A4 but doesn't actual change to A4 until I click ok. If i try to print any of the reports from report manager it prints as letter  - including if I export to .pdf! HELP!!!

 

Answer 22

Rajeev Karunakaran wrote:
In the Report Properties dialog if I set  Page width to 8.27in and Page height to 11.69in then the Page Setup dialog of ReportViewer defaults  to A4.

In the Report Properties dialog if I set Page width to 11.69in and Page height to 8.27in then the Page Setup dialog of ReportViewer defaults to A4, and Orientation defaults to Landscape.

Thanks Rajeev, this workaround also solved this rather frustrating problem for me this morning.

Cheers,

Crispin.

 

Answer 23

Our product uses SQL reporting services for its reports. Only one out of around 200 of our customers is affected by this issue, and nobody else that uses it has this problem.

We have tried all of the workarounds in this thread but nothing has worked for them. They have around 10 different print drivers and the same problem occurs with all of them. What could it be that is causing it to only affect them?

When will this be fixed?

 

Answer 24

For those of you who prefer centimetres, the actual page size  of A4 (Portrait) is 21.0058cm x 29.7cm which is an exact conversion from the inches values provided in earlier posts.

If these values are entered in the Report Layout properties rather than 21cm x 29.7cm, you will get A4 rather than Letter.
 

Answer 25

Oh ... there's still need for an update !!

Yes you CAN use 21.0058cm x 29.7cm and get the right (A4) values in the Page setup  dialog - but what about the margins ??

Yuo can use inches in the properties 2.5in;1in;1in;1in and get 25mm, 10mm, 10mm, 10mm in the Page setup dialog BUT when you print out the report it STIL USES the inches !!!!!!

And I HAVE danish language !

So an updata is needed very fast I think - don't you ?

Best regards
KSor, Denmark
 

Answer 26

 It is an omission (and one that Microsoft intend to correct in the future) that the print settings from the report definition can't be overridden for the built in print functionality, though you can always print manually as a workaround....


... MICROSOFT PLZ FASTER ...



http://forums.msdn.microsoft.com/en-US/vsreportcontrols/thread/a0b7e970-00fc-4035-9206-e4fb45b2cf1c


Abbas Keshvari... Web Developer and Programmer
 

Answer 27

Is there any answer on what Richard1234567 and Priddin are asking for?

I find myself in same situation...
 

Answer 28

Not wanting to be pedantic, or anything, but A4 is actually
21.02241038 * 29.73017788.

Not that many of us can see the last micron of width.
 

Answer 29

Rajeev Karunakaran wrote:
In the Report Properties dialog if I set  Page width to 8.27in and Page height to 11.69in then the Page Setup dialog of ReportViewer defaults  to A4.

In the Report Properties dialog if I set Page width to 11.69in and Page height to 8.27in then the Page Setup dialog of ReportViewer defaults to A4, and Orientation defaults to Landscape.

Thanks Rajeev, this workaround also solved this rather frustrating problem for me this morning.

Cheers,

Crispin.


Yeahh! I also stuck with this problem! And now has solved! Thank you very much

LongIsland.
 

Answer 30

what is the detail operation?
 

Answer 31

You can edit the report file in visual  studio as pure xml.  You can Accurately manipulate paper  size here to match the paper size  seen in the printer dialog.. E.g Im using an epson printer with only 80mm with paper and this works fine.

Neil
 

Answer 32

Hi All,

 

Even i got stuck with the same issue.

i need to print few reports in all combinations below

Letter  Potrait  

Letter Landscape

Legal  Potrait

Legal landscape

But all the reports in print preview show Letter and Potrait Orientation By default and the users are not will to set  them manually every time they print the report using report control  viewer.

 

So please help me find a solution for this.

 

I have set both Page size  and interactive size as per the Legal and Letter sizes US (for bot Landscape and potrait orientations )

 

Answer 33

how to change the print setting in report viewer,

am using microsoft report viewer in windows  applications for my project to use print in the printsetting,is there any way to set  the paper  size for the Reportviewer control  other than at runtime  using the Page Setup button. It always defaults  to "Letter(size:Hight11.60 Width8.40inc)"   but i need Hight4.00 & width8.40inc for default,. how can i set that as default

 

 

please can u help me

 

Answer 34

Hi,

One way to set  the paper  size at run time, and I'm not sure is the proper way, is to change the XML of the RDLC file itself.

I'm using something like :

XmlDocument xDoc = new XmlDocument();
      xDoc.Load(ReportPath);
      XmlNamespaceManager nsmgr = new XmlNamespaceManager(xDoc.NameTable);
      nsmgr.AddNamespace("nm", "http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition");
      nsmgr.AddNamespace("rd", "http://schemas.microsoft.com/SQLServer/reporting/reportdesigner");
      try
      {
        // set the width and height with the new values
        if (xDoc.DocumentElement != null)
        {
          xDoc.DocumentElement.SelectNodes(String.Format("//nm:{0}", "InteractiveHeight"), nsmgr).Item(0).InnerText = Height;
          xDoc.DocumentElement.SelectNodes(String.Format("//nm:{0}", "InteractiveWidth"), nsmgr).Item(0).InnerText = Width;
          xDoc.DocumentElement.SelectNodes(String.Format("//nm:{0}", "PageHeight"), nsmgr).Item(0).InnerText = Height;
          xDoc.DocumentElement.SelectNodes(String.Format("//nm:{0}", "PageWidth"), nsmgr).Item(0).InnerText = Width;
        }
      }
      catch { }

After that I load the xml back using the ReportViewer.LocalReport.LoadReportDefinition   method

Hope this helps you.

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter