Home General

Previewform on Multidisplay with different DPI settings

edited September 2020 in General
Hi, we have a very crazy problem with Delphi 10.3 or 10.4 with following setup:

1. Screen with 100%
2. Screen with 125%

Mainform is started at Monitor 125%. Opening Previewform from Reportbuilder is very crazy. form is i.e. 800*500px but the area where the report is shown is only 400*250px (round about) and is showing scrollbars ....

Can you please check this asap?
Yusuf Zorlu
MicrotronX - Speditionssoftware vom Profi
https://www.microtronx.com

Comments

  • Here's the image:
    image
    Yusuf Zorlu
    MicrotronX - Speditionssoftware vom Profi
    https://www.microtronx.com
  • Problem is in ppPreview.pas in Line 1063

    Viewer.Top := 2;
    Viewer.Left := 2;
    Viewer.Height := Viewer.Parent.Height-4;
    Viewer.Width := Viewer.Parent.Width-4;
    Viewer.Anchors := [akLeft, akTop, akRight, akBottom];

    I removed these lines and replaced with following lines:

    Viewer.AlignWithMargins:=true;
    Viewer.Margins.Top:=2;
    Viewer.Margins.Left:=2;
    Viewer.Margins.Right:=2;
    Viewer.Margins.Bottom:=2;
    Viewer.Align := alclient;

    Now the problems are solved!
    Yusuf Zorlu
    MicrotronX - Speditionssoftware vom Profi
    https://www.microtronx.com
  • Hi Yusuf,

    Please provide steps to reproduce/test this behavior. I tried setting to 125% and calling Report.Print, but the preview form shoes correctly.


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • Hi Nard, i have nothing special setup. Possible that loading position and formsize beforeshow is the problem but changing your code so the viewer always do alClient with Margins solves that problem.
    Yusuf Zorlu
    MicrotronX - Speditionssoftware vom Profi
    https://www.microtronx.com
Sign In or Register to comment.