Skip to Content
0

When linking Objects to a report png images appear and print, .jpg images do not.

Dec 07, 2016 at 06:39 PM

73

avatar image
Former Member

I am linking OLE Objects into a report. When the image is a .png, it will appear and print correctly. When the image is .jpg, a blank space appears in the report. The images are all located in the same folder on our network. Why do only the .png images work correctly?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Dell Stinnett-Christy Dec 08, 2016 at 06:48 PM
0

What version of Crystal are you using? And is it "classic" Crystal Reports or is it Crystal for Enterprise for use with BusinessObjects or Crystal Reports Server?

-Dell

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Dec 12, 2016 at 07:49 PM
0

Crystal Reports 2013. I do not believe it is enterprise.

Share
10 |10000 characters needed characters left characters exceeded
Dell Stinnett-Christy Dec 13, 2016 at 02:38 PM
0

I'm not absolutely certain but you may have to have two different OLE Objects - one for the .png files and a separate one for the .jpg files. I'm guessing that when you designed the report you selected a .png file when you configured the image object. If that's so, then the OLE object for the image is expecting a .png and doesn't know how to handle. .jpg.

If a given row in the report can have either a .png or a .jpg, but not both and by "linking" you mean that you get the name of the image file from your data, here's what I would do:

1. Add an image to the report where you use a .jpg as the default image. Configure this like the one for the .png file so that it will dynamically load the image. Make it the same size as the .png image object. Right-click on the object and select "Format Image...". In the "Suppress" formula, enter something like the following:

uppercase(right({image file name field}, 3)) <> 'JPG'

DO NOT check the suppress checkbox!

2. Right-click on the .png image object and select "Format Image...". In the "Suppress" formula, enter something like the following:

uppercase(right({image file name field}, 3)) <> 'PNG'

DO NOT check the suppress checkbox!

3. Select both image objects. Right-click on the one for the .png file (assuming that it's the one that's in the right location). Select "Align" and then "Tops". Do this again to align the lefts of the objects.

This process will set it up so that one or the other image will show in the same place on the report based on the data.

-Dell

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Dec 14, 2016 at 06:31 PM
0

I added the formula to the "Format Image..." Suppress box, however the jpg is still not printing. I am unclear from your post above if there is another location that sets the default image type.

,

Is there another location where the default image could be set? We tried entering the code you listed above in the Format Image/suppress formula box and still could not print the jpg.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Can you open the .jpg in other software (i.e., is the file a valid .jpg file?)

Try just creating a test report that has a single image that you've added that points to a .jpg. Does that image appear?

I'm not sure how this new version of the SAP Communities allows attachments - it would be great if you could attach a copy of the report that you've saved with data here so that I can look at it. Another option would be for you to go to my website - http://www.dellstinnett.com - to get my email address and then send the report to me there. I'll take a look at it and see what I can find for you.

-Dell

0
Dell Stinnett-Christy Dec 15, 2016 at 02:55 PM
0

Hi Beth,

Thank you for sending me the report to look at. I have sent it back to you.

I tweaked the image subreport a bit. Instead of overlaying the two images, I put them in separate sections and suppressed the sections based on the image type.

I also tweaked all of the suppression formulas in that subreport.

[soapbox]When you have an If statement that contains "then true" or "then false" then you don't need the if part of the statement. The individual pieces each return True or False and all you have to do is combine them with AND or OR. For example, the formula for suppressing the section that contains the .jpg image is:

isnull({PM_ItemLinkFile1.LinkFile}) or {PM_ItemLinkFile1.LinkFile} = "" or
Uppercase(right(trim({PM_ItemLinkFile1.LinkFile}), 3)) = 'JPG'

[/soapbox]

Please let me know if you have any questions.

-Dell

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Dec 16, 2016 at 09:26 PM
0

Thanks, Dell.

I sent you an email back. We're close. The jpg image is printing, however, it is not printing the complete image. Several components within the image are left out. Could this be related to the image size?

Share
10 |10000 characters needed characters left characters exceeded