Right align image in RDLC report
Asked Answered
O

2

7

I want to right align a proportionally scaled image, on a page in the report. Seems like images are always aligned left in their bounding box.

The image however, is dynamically assigned. So no, I can't just position the image in the right position.

All ideas welcome :)

Image

Overhead answered 2/12, 2010 at 9:51 Comment(0)
C
4

It's not possible.
However, you can dynamically set the padding-left value.
Doing that correctly is a pain, though.

Childhood answered 16/8, 2011 at 13:4 Comment(0)
D
0

Obtain the height and width of the image control, and apply this answer to add just as much white or transparent left padding to the picture itself to make it appear right-aligned inside the image control.
This will incur additional processing time and memory consumption, but saves you the pain the accepted answer is talking about.

Desiccant answered 4/9, 2017 at 15:31 Comment(1)
Disagree - this requires more processing, as you change the image. if you save the image dimensions with the image, then you can just subtract the image width from the rectangle width to get the padding-left value, no image processing necessary. Of course, you'd also need to calculate the new image dimensions first, because you'll probably want to proportionally resize the image so it fits the display rectangle before you apply the padding. The change in dimension due to proportional resizing is the pain i'm talking about.Childhood

© 2022 - 2024 — McMap. All rights reserved.