Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReportViewer: Show reports in Print Layout with Page Width zoomMode

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

like image 987
Aqua267 Avatar asked Mar 29 '13 14:03

Aqua267


3 Answers

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

like image 144
Saleem Kalro Avatar answered Nov 18 '22 11:11

Saleem Kalro


Nevermind, I figured zoomMode could be set this way:

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

like image 28
Aqua267 Avatar answered Nov 18 '22 11:11

Aqua267


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.

like image 5
Adolfo Mejía Avatar answered Nov 18 '22 13:11

Adolfo Mejía