Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

crystal reports image squashed

Is there any way in Crystal Reports(v11, if this matters) to prevent the images from stretching itself to fit in the whole OLE-object? I'm loading the images dynamically from a database and don't know their aspect ratio.

Thanks for help.

like image 309
mulm Avatar asked Nov 23 '10 08:11

mulm


People also ask

How to fix image size in Crystal report?

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). I know, that's sad...

How do I stretch an image in Crystal Reports?

Insert the image in your report then right click on the image and go in 'Format Graphic'--Picture tab under this there is a 'size'. Adjust width and height according to your requirement.

How do I change the view in Crystal Reports?

In Crystal Reports Designer, click on File\Printer Setup. Change the orientation by clicking on the button next to the word 'Landscape' Click on OK and the Design view of the report should change to reflect the Landscape Orientation (ruler should increase to 11")


2 Answers

i found the answer here

To make the image resize properly, you must perform the following steps in order:

  1. Set the image's EnableCanGrow to true
  2. Calculate and set Width and Height to the needed size
  3. Set the image's EnableCanGrow to false
  4. Fill the DataSet's image object with data
  5. Continue with normal report processing.

If you get these items in the wrong order, or skip an item, you will find that Crystal Reports scales the image in unexpected and unrecoverable ways.

like image 164
Emanuele Greco Avatar answered Sep 22 '22 14:09

Emanuele Greco


The Crystal OLE object, which shows pictures from files, can only be set programmatically so for a 'pull' type report, where you are supplying a dynamic image name, of either portrait or landscape orientation, at least one of those orientations will get squashed to fit. It is better, IMHO, to show thumbnails and then have a calculated hyperlink to show the real picture in some decent viewer. You will spend an unreasonable amount of time trying to get the OLE object that shows pictures to understand that your image has a different aspect ratio. As long as it is at least reasonably legible that may have to suffice.

like image 25
Allen Avatar answered Sep 21 '22 14:09

Allen