trigger OnAfterGetRecord() var RecordTenantMedia: Record "Tenant Media"; RecordmageWidth: Decimal; RecordImageHeight: Decimal; begin if Record.Picture.Count > 0 then begin RecordTenantMedia.Get(Record.Picture.Item(1)); RecordTenantMedia.CalcFields(Content); RecordImageWidth := Round(RecordTenantMedia.Width * 0.75, 1, '='); //converting to Pt RecordImageHeight := Round(RecordTenantMedia.Height * 0.75, 1, '='); //converting to Pt //500 is the width of the layout image box //300 is the height of the layout image box RecordImagePadding := Round((500 - round((RecordImageWidth / round((RecordImageHeight / 300), 1, '=')), 1, '=')) / 2, 1, '='); end; end;
=Cstr(Last(Fields!RecordImagePadding.Value)) + "pt"
Answers
I then went to Report Properties, Size, and set the left padding to the expression