crystal reports image squashed

10,031

Solution 1

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.

Solution 2

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.

Share:
10,031

Related videos on Youtube

mulm
Author by

mulm

Updated on June 04, 2022

Comments

  • mulm
    mulm almost 2 years

    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.

  • brichins
    brichins over 4 years
    First 3 steps were sufficient when binding the image source to a path, even when changing size after setting the parameter value. So stupid that this is needed, I had to do this in code even when the image object was already set to Can Grow = false in the .rpt editor UI.