Forum Discussion

MikkoRiese's avatar
MikkoRiese
Copper Contributor
Dec 10, 2023

Report - Image Background in preview grey

Hello,

i have a report where i want to display different images.

While it looks nice in the report view, the background in preview (and therewith in the pdf) is grey in the region not filled by the image. So if there is no image than the whole field is grey.

 

Any idea how i can make the preview look the same as the report view? 

  • Thanks. I am also going to ask a colleague who is much more involved with managing images to take a look at this problem.
  • George_Hepworth's avatar
    George_Hepworth
    Silver Contributor

    MikkoRiese 

    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.

    • MikkoRiese's avatar
      MikkoRiese
      Copper Contributor

      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_Hepworth's avatar
        George_Hepworth
        Silver Contributor

        MikkoRiese 

        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.  

         

Resources