7

I am using C# winform reportviewer 2010.

I changed the default option to view reports to Print Layout (Whole page) with SetDisplayMode(). However since Whole Page is the default zoom option for print layout, even if I set the ZoomMode to PageWidth in the designer,when the report loads, it resets to Whole page. Is it possible to programatically set the ZoomMode to Page width after setting the displayMode?

Thanks

Aqua267
  • 873
  • 3
  • 12
  • 35

5 Answers5

6

reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);

Saleem Kalro
  • 1,046
  • 9
  • 12
5

Nevermind, I figured zoomMode could be set this way:

this.reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.PageWidth;

Aqua267
  • 873
  • 3
  • 12
  • 35
5

Maybe you can do like this:

  1. Fill all report parameters

  2. Then you refresh your report in order to show your data

    myReport.RefreshReport();

  3. Finally set this properties

    myReport.ZoomMode = ZoomMode.Percent; myReport.ZoomPercent = 100;

I hope it helps you.

Alexei - check Codidact
  • 22,016
  • 16
  • 145
  • 164
Adolfo Mejía
  • 51
  • 1
  • 2
1

After refresh your rdlc report write

my_Report.ZoomMode = ZoomMode.PageWidth;
my_Report.ZoomMode = ZoomMode.FullPage;
my_Report.ZoomMode = ZoomMode.Percent;
Ali Hamza
  • 55
  • 4
0

After reportViewer1.RefreshReport(); you can add

reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout); reportViewer1.ZoomMode=ZoomMode.PageWidth;

Community
  • 1
  • 1