Aqua267
Aqua267

Reputation: 953

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

Upvotes: 8

Views: 26106

Answers (5)

mohammed elshoraky
mohammed elshoraky

Reputation: 79

After reportViewer1.RefreshReport(); you can add

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

Upvotes: 0

Ali Hamza
Ali Hamza

Reputation: 65

After refresh your rdlc report write

my_Report.ZoomMode = ZoomMode.PageWidth;
my_Report.ZoomMode = ZoomMode.FullPage;
my_Report.ZoomMode = ZoomMode.Percent;

Upvotes: 1

Saleem Kalro
Saleem Kalro

Reputation: 1142

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

Upvotes: 7

Adolfo Mejía
Adolfo Mejía

Reputation: 61

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.

Upvotes: 6

Aqua267
Aqua267

Reputation: 953

Nevermind, I figured zoomMode could be set this way:

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

Upvotes: 5

Related Questions