Variable Image Height not Paging Properly

I'm using Firemonkey (Alexandria) and version 2022.1 of Fast Report. I have a report that prints a detail line and then any images for that item in a subreport below the detail line. I adjust the height of the image in the subreport with code in the .fr3 based on whether the image is in portrait or landscape format, since I am trying to limit the blank space in the report. However, it seems if the image does not quite fit in the remaining space on the page it does not print the image on the next page, but instead causes issues with the following detail line (pushing it way down the next page).

Here is the internal code I'm using in the report:

procedure Picture1OnBeforePrint(Sender: TfrxComponent);

begin

 if (<frxDBPictures."Picture1"> = '') and (not <PicPrinted>) then begin

  txtNoPictures.Visible := True;

  PicHeader.Height := fr1in * 0.20;

  Picture1.Visible := False;

  Picture1.Height := fr1in * 0.20;

  Picture1.Width := Picture1.Height;

  PicData.Height := fr1in * 0.20;

 end

 else begin

  txtNoPictures.Visible := False;

  PicHeader.Height := fr1in * 0.25;

  Picture1.Height := fr1in * <PicHeight>;

  Picture1.Width := fr1in * <PicWidth>;

  Picture1.Visible := True;

  PicData.Height := fr1in * <PicHeight>;

  PicData.ColumnWidth := Picture1.Width;

 end;

end;

Code in the program itself sets the values of PicHeight and PicWidth based on the particular image, but limited to 3.5 inches wide.

What do I need to do to get the image to print on the next page if it does not fit on the current page?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.