Forum Discussion
Report - Image Background in preview grey
- Dec 11, 2023Thanks. I am also going to ask a colleague who is much more involved with managing images to take a look at this problem.
It depends in part on why there is no image in certain situations. How are you selecting the different images?
Reports have events which fire in Print Preview and Print, but not in Report view. One of them might be used to make the image control visible or not visible, according to whether there is an image in the image control, but we need a bit more detail to sort out a way to take advantage of that.
Hello George_Hepworth ,
thanks for the quick answer.
Images are direcly stored in the table.
Not only if there is no image the whole image box is grey, but also if images are smaler the part where no image is, is grey.
If the picture box would be invisible it stil should be white as the whole background is white.
- George_HepworthDec 10, 2023Silver Contributor
Thanks, I'll reserve comment on storing images in tables inside an accdb for the moment.
Here's where you should be able to change the background for the image control in which the images display.
You can change the background style and background color. Here I used White, which is hex code #FFFFFF but you can change it as you choose.
If that isn't sufficient to change the appearance as you need, maybe we'll have to look at the accdb to see what else could be related.
Now, storing images in tables in Access.
Images are large enough to cause the overall size of an accdb to grow much more than the same data with no images. It can cause the accdb to bloat to the point where it becomes unusable. For that reason, most experienced developers have learned to avoid this approach except when the number of such images is quite small and not likely to change over time. Maybe a handful of company logos for reports, for example.
There are other approaches which are more efficient, albeit they require more planning and more work to implement. However, the extra effort is generally well worth while. If you want to look at an example, there is a downloadable sample here on my website.
- MikkoRieseDec 11, 2023Copper Contributor
Good morning George_Hepworth ,
i normally do not store the images directly in the database. But this is how the customer wants it to be. And it is an sql server as backend. The number of images will stay below 500-600. At the moment these are roughly 300.
I used the same settings as you did:
In the report view everything looks nice
But in the preview it does not. And the problem is that the preview is how it looks as pdf.
- George_HepworthDec 11, 2023Silver Contributor
Ah, you didn't mention that the Back End is in SQL Server.
The only other thing I can think of would be to use the Format event of the report section where the image control is. You can make the image control visible or not visible, depending on whether there is an image in the image control.
In the screenshots, there are other display differences between the report view and print preview appearance of the images.
What image format is used? jpg, png or something else?