Crystal Reports will insert certain images but not

2019-04-27 20:22发布

Are there specific requirements for images that are to be inserted into CR?

I’m trying to insert an image into Crystal reports, but nothing happens after I select my file. I have a different image that I’ve used for testing that inserts with no problems so I’m assuming that it has something to do with the JPG file settings when saving the image. Note that this is just a static logo for a page header – nothing is being dynamically loaded.

I know that GIFs cannot be used, so I’ve tried JPG and PNG to no avail. I’ve even saved my “working” image again through Photoshop and it will insert. I’ve then used those settings to save the non-working image, but that image wont insert. I’ve used Crystal Reports a lot in the past and this is the first time I’ve come across this issue and my searches lead me to a variety of resources for dynamic image inclusion, but nothing to for this hopefully simple issue.

I’m using Crystal Reports for Visual Studio 2010.

Link to images used in testing

4条回答
Summer. ? 凉城
2楼-- · 2019-04-27 20:37

The reason is because the format is not supported, I had exactly the same problem but when I saved the file as JPG it started working perfectly!.

查看更多
成全新的幸福
3楼-- · 2019-04-27 20:43

i think crytal report does not accept some image formats but what i did when i encountered the problem was to 1. open the image with coreldraw 2. copy the image content of the image and paste it in the crystal report instead of using the insert tool on crystal report and it worked

hope this will also be helpul.

查看更多
ゆ 、 Hurt°
4楼-- · 2019-04-27 20:45

Worked AOK for me. Check if you have all the latest patches. I've attached a screenshot in Crystal 2011 and saved the .rpt for you to try and open in Visual Studio 2010: http://speedy.sh/RGgfg/crimages.zip

enter image description here

查看更多
放荡不羁爱自由
5楼-- · 2019-04-27 20:57

After messing with this problem all day, I found out it’s a bug in the Crystal Reports IDE.

Here’s how to duplicate the issue:

  1. Right click on your report and select Insert >> Picture
  2. Double-click on the image that you wish to insert.

Depending on your image and how the image was saved in Photoshop, it may or may not insert into the report. I’ve had mixed results and apparently some images work and some do not. I haven’t quite figured out the pattern yet, but I believe it has to do with the color profiles of the image. I probably won’t waste any more time investigating it, because the following resolution has worked for me every time and I can import every image that I’ve created in Photoshop regardless of how the image was saved and the settings used to save the images. (Assuming that they’re all JPGs, of course.)

Resolution:

  1. Right click on your report and select Insert >> Picture
  2. SINGLE-click on the image that you wish to insert to select it.
  3. Click “Open”

The image should insert into the report properly.

It’s a subtle difference, but I hope this saves someone else a few hours of debugging.

Dave

查看更多
登录 后发表回答