0

When printing/previewing reports in VFP and display scaling is > 100%, the report preview is enlarged, but the "paper size" is not, and this is causing the report to be cut off. Note: the gray area around the image is the preview background indicating the size of the "paper".

Example of report being cut off with scaling 150%

Example of report with scaling 100%

I have tried a custom manifest setting the dpiAware to true.

<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
        <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True</dpiAware>
    </windowsSettings>
</application>

EXE with manifest to observe DPI awareness. I tried using the API to set it.

DECLARE INTEGER SetProcessDPIAware in WIN32API
=SetProcessDPIAware()

The only thing that seems to work is overriding the high DPI scaling in the shortcut. The problem with that is the application is used on laptops and the screen is fairly small, so the forms are too small and the customer doesn't like that solution.

Somewhere, I read that FoxyPreviewer handed that issue, but it isn't (not for me). I can't remember where I saw it.

I'm running on Windows 10 Build 17134. VFP9 SP2.

dashrader
  • 317
  • 3
  • 14

1 Answers1

0

Save the following manifest as exeName+".exe.manifest" on your project folder. ( VFP9 Sp2 will include it upon exe generation. )

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity version="1.0.0.0" type="win32" name="Microsoft.VisualFoxPro" processorArchitecture="x86" />
    <description>Visual FoxPro 9 application</description>
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
        <security>
            <requestedPrivileges>
                <requestedExecutionLevel level="asInvoker" />
            </requestedPrivileges>
        </security>
    </trustInfo>
    <application xmlns="urn:schemas-microsoft-com:asm.v3">
        <windowsSettings>
            <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True</dpiAware>
        </windowsSettings>
    </application>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" language="*" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" />
        </dependentAssembly>
    </dependency>


    <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> 
        <application> 
            <!-- Windows 10 --> 
            <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
            <!-- Windows 8.1 -->
            <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
            <!-- Windows Vista -->
            <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> 
            <!-- Windows 7 -->
            <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
            <!-- Windows 8 -->
            <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
        </application> 
    </compatibility>


</assembly>

Marco Plaza
  • 319
  • 1
  • 5
  • Unfortunately, that met with the same fate as my prior attempt. I built the EXE, set my monitor t o125% scaling, launched the test EXE, and observed that the report was still not ignoring the scaling. I will add a screenshot above of the manifest inside the EXE. – dashrader May 12 '21 at 13:57