Howto force Report Viewer to be shown in print preview mode
-
23-08-2019 - |
Question
In Visual Studio 2005, how can I show a report in ReportViewer control directly on Print-preview mode?
Solution
Use the SetDisplayMode()
method:
MyReportViewer.SetDisplayMode(DisplayMode.PrintLayout);
OTHER TIPS
In Windows Forms application if you call the SetDisplayMode method in reportviewer's RenderingComplete event it may cause StackOverflowException. It is not correct place to call the method.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow