Home Devices
New Blog Posts: Merging Reports - Part 1 and Part 2

AutoSize Not Sizing Properly on First Preview (Regression from 20.04 to 22.04 - Delphi 10.4 to 12)

We are using a TppDBText control that we are populating with lines of text that can look like this:

61194 - FRESH 47 86 3/14 3/27/26 FRESH 656 9 35 31 0 ___________________

61251 - FRESH 42 92 4/16 4/ 9/26 METRITS EXC4IM 532 2 28 41 0 ___________________

61365 - FRESH 31 104 6/23 4/12/26 FRESH 568 0 35 30 0 ___________________

Each line is fed into the TppDBText control via the DB pipeline, and the control has its AutoSize property set to True (no word wrap, though). With Delphi 10.4 and RB 20.04, the first and subsequent previews of the report look fine, but with Delphi 12 and RB 22.04, the first preview draws the text very small and the second and subsequent previews work just fine.

We tried the latest RB with Delphi 12, just to make sure that this isn't already fixed, but the behavior remained consistent.

The one wrinkle is that we are adjusting the font height before printing/preview:

procedure SetFont(Ctrl: TppCustomText);
begin
Ctrl.Font.Name := FTheFontName; // This is normally just Courier New or something similar
Ctrl.Font.Size := FTheFontSize;
Ctrl.Font.Height := Ctrl.Font.Height + 1; <<<<<<<<<<
end;

This was done as a compatibility "shim" to keep the font size consistent with a prior Rave Reports implementation.

When the font height modifications are taken out, the print preview stops exhibiting the "small font drawing" behavior and the preview is accurate in terms of font size from the first preview onward, but the drawing still cuts off everything on the right past the first underline character that starts the series of underline characters at the end of each line.

Any ideas ?

Thank you !

Comments

  • Hi Ed,

    Please create a simple example demonstrating this issue using only Delphi and RB components and send it in .zip format to support@digital-metaphors. I will test it with RB 20.04 and the latest to find out what is happening.
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Thanks, Nico, it's on its way.
Sign In or Register to comment.