I have a Winforms application (in Visual Studio 2010) that contains a Report Viewer control that previews and prints an A4 size report.
One user has his Windows font size set to 150% (i.e. a system DPI change) and when he runs the report, it is shrunk to 2/3 size in both the Report Viewer preview and the printed report.
The AutoScaleMode property of the form containing the Report Viewer is set to "Font", although it doesn't seem to affect the report if I change this.
This isn't a font (missing/scaling) issue as I have an example program to demonstrate the problem that contains nothing but a rectangle that takes up the whole page.
It seems I need some way to specify in the report itself that it should be rendered at 96dpi regardless of the system dpi setting, but can't see anywhere that I can specify this. What am I missing?
Thanks, David
There are three options to resolve the display problem: Restart Visual Studio as a DPI-unaware process. Add a registry entry. Set your display scaling setting to 100%
Right-click the application, select Properties, select the Compatibility tab, and then select the Disable display scaling on high DPI settings check box.
I ran into the same problem. WinForms ReportViewer is already DPI aware and will do its own scaling. You just have to tell the system that your application is DPI aware so that the system doesn't try to scale it after.
Add a manifest to your application if you haven't already, then inside the tag, add the following:
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
You can also use an API function SetProcessDPIAware, but it is recommended against: http://msdn.microsoft.com/en-us/library/ms633543.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With