Search code examples
crystal-reports

How to set max height of a picture in crystal report?


Is it possible to set maximal height of a picture in crystal report and preserve original ratio of a picture? If can grow is disabled, every picture is streched or shrinked to default picture object size, if is enabled, I'm losing limits of picture size. I'm using crystal reports for VS 2013 (13.0.5)


Solution

  • The answer is No. I did many tests and researches and I didn't found any way to control the height and, without controlling the height, it's not possible to fit an arbitrary image in the object box and keep is ratio at the same time.

    Looks like it's and old problem.

    But if all your images are limited to the same dimensions, like you have set your limits to 500x500, so you can have, for example, images that do 500x200, 500x500, 250x500, etc., there's a way to do it.

    The object box needs to have the same ratio as your limits. In my example, 500x500, the ratio is 1:1 (square) so your object box needs to be square also. You need to check Can grow and, in the Image tab, set the size exactly like the object box's size. You also have to set the bitmap image size (right-click on the box, choose Bitmap Image Object then Modify) to the image limits (500x500).