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.
i found the answer here
To make the image resize properly, you must perform the following steps in order:
Set the image's EnableCanGrow to true
Calculate and set Width and Height to the needed size
Set the image's EnableCanGrow to false
Fill the DataSet's image object with data
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.
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.
I don't think Crystal can help you. Try looking for some kind of command-line based app on the internet which can automically resize pictures (add black space, reduce in a 1:1 ratio, etc). I'm sure they're out there.
Related
I've got a crystal report built from v. 14.0.
Inside the report I've got a picture object that I've set the scaling properties to 33%.
The graphic location is set to pull from our DB.
I have two different images that I need displayed there depending on parameters passed into the report.
They are both 300 DPI, 1950 x 319.
Of both images, one pulls in wrong. It seems like it's scaling to 33% OF whatever 33% of the original image size is. Basically looks like 1/3 of what it should look like.
The other image pulls in exactly how it should look # 33% scaled.
The scaling doesn't change in the picture object properties when each image is loaded, it stays # 33%. If I change the one that comes in wrong to 100% scaled, then it looks correct which is weird, because # 100% it should be way bigger.
I've tried copying the bad image into the good image and resaving but the same thing happens, the scaling gets set wrong.
I can't figure out what's different about the images that's causing this weird behavior.
I've tried saving the images to bmp format but the same thing continues to happen. I've saved the images with multiple versions of photoshop and still nothing changes.
Is anyone able to point me in the right direction here? Thank you.
After much research we've identified something in the exif info that is causing this issue.
There's a block in the image that doesn't work called app0 that contains the jpg file interchange format information. I don't know a whole lot about it other than we used an app called photostudio.exe to look at the exif info.
We then used a tool called exiftool to remove that block from the exif info.
After doing so, the image scaled perfectly to 33%.
It's almost as if Crystal is scaling, then looking at that first app0 exif block and failing, then scaling again (effectively just retrying their method), and looking at the next blocks without failing any further.
When I set the database image Sizing property to 'Fit Proportional' and export the document to WORD some of the database images fail to render. If on the other hand the image sizing property is 'Fit to Size' then all the images always render when exported to WORD. I eliminated all report elements except the image in the body but the results are the same.
Additional Info: The image is not nested in a rectangle or table. The DB images originated as jpegs and are stored as VARCHAR(max).
I think the issue is more of a Word problem than SSRS. When you say "some" images fail to render when set to "Fit Proportional" that makes me think that the image is too large to fit on the page therefore not displaying.
I would guess the images that don't go beyond the margins of the page are the ones that display properly.
HTH
I also had this problem. I was trying to export to Word and some images were not showing while others were. I found this thread:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/211c2ee1-30a7-4c42-88bd-88333a6fe988/missing-images-in-headerfooter-when-exporting-to-word-in-ssrs-2008-r2?forum=sqlreportingservices
Someone suggesting reducing the image size before importing it into SSRS. That worked for me, so it might help you.
I am trying to modify the default I-beam cursor image. I'm using [[[NSCursor IBeamCursor] image] representations], passing each one through a CIFilter and adding it to a new image. However, the resulting cursor looks as though it is rendering the low-resolution images.
The High Resolution Guidelines say:
For custom cursors, you can pass a multirepresentation TIFF to the NSCursor class method initWithImage:hotSpot:.
So I would expect this to work. Additionally, if I get the -TIFFRepresentation of the original image and my modified image, and write them to disk, they both look like multi-page TIFF files with the same size images. What could I be doing wrong?
I have a somewhat-temporary solution: manually call -setSize: on each image representation, dividing the pixel height and width by the screen's scale factor. However, this technique doesn't seem like it will work ideally with multiple screens.
You're right on. I've been debugging this all day and I'm pretty sure I've got it nailed. I'm not doing exactly the same thing you are (my images are loaded from a file) but the end result is exactly the same.
The trick is to set the first representation of the multi-representation image to the non-retina size. If you are loading your cursors from an image file, you must take this extra step to adjust the size of the representations to match. It doesn't work 'out-of-the-box' as you would expect.
I've tested this on a machine with two monitors and dragging the window from the retina display to the non-retina display acts as it should, displaying the high/low resolution images for the cursor.
I had a similar problem a while ago: I had my cursor in a PDF, and it always drew as if it was a pixel image at 1:1 size, blown up. There's a solution to that in NSCursor: Using high-resolution cursors with cursor zoom (or retina).
Maybe someone can use that technique to solve this problem? My guess is creating an image with the same size but a different CTM marks it as the same size but Retina. What #jtbrandes is doing probably marks it as a different size and non-Retina. So you're effectively losing the scale factor information. If you create an image with a CTM in the hints, maybe you can draw the filtered images into it and it'll be detected right.
I would like to loop through a sequence of images. I have tried using a Pivot control, but I don't like the blank space in between image transitions. I would prefer to use something that will animate between images smoothly. I also looked at the LoopingSelector control, but I can't seem to set the orientation to horizontal.
I'm assuming you're interested in a kind of image viewer like iOS offers, swiping right or left to navigate through the photos. If that's the case, I hate to say it but i think you're looking at building your own control.
I think to implement it properly these are the essential things you need to think about and address:
For performance' sake, load all the images you have into memorystream objects and store the binary data (you can get creative with this and only store the first 10-15 images, depending on how large the images are, doing this would enable your control to support thousands of images and still perform like a champ).
Once an image is about to be on-screen set the source of the image to the saved memorystream object that has the bytes loaded into it (this will minimize the work that the UI thread does, keeping the control performant and responsive)
Use Manipulation events to track the delta x of the motion someone uses when swiping left to right in order to actually perform the moving of the items
Move the images by changing their Canvas.Left property (you can go negative I think, otherwise just make your canvas the width of all the images you have combined)
Look up some of the available libraries to support momentum so you can have a natural smooth transition between images
This is probably a long shot, but I have vague sense I ran across this many years ago so I'm hoping someone can help.
I have a static image in a Crystal Report page header that acts as a letter head. Everything looks fine in the designer, but at run-time the image displays a black line along the bottom of the image. Kind of like a border, but the line is only about a third of the width of the image and aligned to the right.
Borders for the image are set to none. I also set the image border color and background color to white. The original image was slightly large, so I resized it in Photoshop to fit the page width, thinking maybe the line was an artifact of Crystal resizing it. No joy. The image is a Jpeg but I've also tried PNG and bitmap.
The other compounding problem is I can't test the report directly on my development machine due to database connectivity issues, so the only way to test is to copy the report file to the user's machine and run it there. Additionally, the user doesn't have Crystal itself but a viewer application my predecessor wrote many years ago. So I wonder if the problem is the user's machine or settings.
You may check to make sure that the image's drop-shadow formatting option isn't set. It's on the border tab if you go to the picture's properties. This is a long-shot, but I decided to throw it out there anyhow. Hope it helps.
The problem was fixed by upgrading the user's Crystal Reports viewer application. I'm not sure what version of Crystal it was built with, but I'm doing report design in XI. I created a new viewer application and the problem cleared up.