Centre-align image in a report [BC24 Cloud]

garmoo
Member Posts: 21
I need to centre-align an image from a Customer card on a report, however the image can be different dimensions depending on what the end user uploads. I found this link which should work for OnPrem instances but in order to do so, you need to set EnableExternalAssemblies property to true on the report and this isn't allowed for Cloud development.
Is anyone aware of another way to centre align images?
Is anyone aware of another way to centre align images?
0
Best Answer
-
I have RecordImagePadding as a column in my dataset which is calculated as below
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;
I then went to Report Properties, Size, and set the left padding to the expression=Cstr(Last(Fields!RecordImagePadding.Value)) + "pt"
0
Answers
-
I have RecordImagePadding as a column in my dataset which is calculated as below
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;
I then went to Report Properties, Size, and set the left padding to the expression=Cstr(Last(Fields!RecordImagePadding.Value)) + "pt"
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions