Difference in page count between ReportViewer and PrintPreview. RRS feed

  • Question

  • Hi, I have a report that when viewed through the ReportViewer is 23 pages long. However, when I Print Preview it, the report grows to 29 pages.

    Has anyone found a clean way to handle this so that both page counts are equal?

    Thank you for your help,
    Tuesday, July 21, 2009 1:19 AM

All replies

  • Check InteractiveSize and PageSize properties, InteractiveSize is used to render page in ReportViewer and PageSize is used to render page to Print.

    If properties has different values, page number will be different in ReportViewer and in Print Preview.

    Tuesday, July 21, 2009 7:54 AM
  • Hi Claudio,

    Thanks for the help. Your answer led me to an interesting discovery. In a post on Friday, July 27, 2007 9:52 PM by DianeY Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals I learned something I hadn't really realized...that being what DianeY is explaining below, that "Print Layout" isn't Print Preview like I thought it was. Its really another viewer and one that works just like the "Normal" viewer, but without the bugs that I've been dealing with. So, I changed my code to:




    ReportViewer.ZoomMode = ZoomMode.PageWidth

    And everyhing works nicely now...



    I figured out my problem.  It suddenly occurred to me that "Print Layout" wasn't actually "Print Preview", but just a different viewing mode!  So, I now just set the viewing mode to "Print Layout" in the form load event:





     ReportViewer.ZoomMode = ZoomMode.Percent


     ReportViewer.ZoomPercent = 100



    Thanks for the help,
    Wednesday, July 22, 2009 2:13 AM