Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

images on a report

Status
Not open for further replies.

yehong

Programmer
Sep 22, 2003
291
US
I have a report that shows images, say img1.bmp,img2.bmp, and img3.bmp.

So, if value of img1 is true then it will show img1.bmp if False then it will not show it, and same is for img2 and img3.
I have placed three images on the report side by side.

img1img2img3

Now whats happening is when img1 is false, then I am seeing a blank space for img1.
img2img3
And if img2 is false, then blank space on img2.
img1 img3
What I want is to remove the blank so that other images appear side by side.
img2img3 and
img1img3

Thanks
 
Add sections and place each image into separate section. Suppress sections instead of images.
 
But then images will apear one above other right?
How can they be displayed side by side? I have 5 images,
img1img2img3img4img5. So if any of the images is blank, the space should be shrinked and it should look like
img1img2img4img5 (say img3 is blank here).

thanks,
 
You need to create all the possible combinations of your five images in different sections.

PageHeader A - img1img2img3img4img5
PageHeader B - img1img2img3img4
PageHeader C - img1img2img3
PageHeader D - img1img2
PageHeader E - img1
| |
| |
| |
etc. etc.

Then supress the sections depending on your requirements.

It's not pretty, but it will work...

 
What determines whether the values are true or false? Are you using parameters for this?

-LB
 
Slightly better idea, but still not too elegant:
put 25 images in the same section -- one above another in 5 groups -- 5 by 5 .. then we again need to program suppressing logic for each image
 
lbass,
I am checking the field value if its 1 then I am displaying image for it, if its 0 then no image.
say for img1:
//supress
{table.field}=0
 
Ok, here's a solution that you can modify to deal with 5 images. This solution is with 3 images.

3 Details Sections:

Details a: Image1
Details b: Image2 | Image2
Details c: Image3 | Image3 | Image3

Formatting:
Details a:
Image1
Underlay Follwing Sections checked
Suppresion formula: {images.img1} = 0

Details b:
Image2(a) | Image2(b)
Underlay Follwing Sections checked
Suppresion formula: {images.img2} = 0
Image2(a) suppression formula: {images.img1} = 1
Image2(b) suppression formula: {images.img1} = 0

Details c:
Image3(a) | Image3(b) | Image3(c)
Suppresion formula: {images.img3} = 0
Image3(a) suppression formula: {images.img1} = 1 or {images.img2} = 1
Image3(b) suppression formula: ({images.imG2} = 1 and {images.img1} = 1) or ({images.imG2} = 0 and {images.img1} = 0)
Image3(c) suppression formula: {images.img1} = 0 or {images.imG2} = 0

I can work up a solution for 5, but this should get you started...

-dave
 
Dave, thanks. I will give it a try and get back to you after Thanksgiving.
 
It's official, I'm a freak...

Here is a solution for 5 images:

5 Details Sections:
Layout your images like the following...
Details a: Image1
Details b: Image2 | Image2
Details c: Image3 | Image3 | Image3
Details d: Image4 | Image4 | Image4 | Image4
Details e: Image5 | Image5 | Image5 | Image5 | Image5

Formatting:
Details a:
Image1
Underlay Following Sections checked
Suppresion formula:
Code:
{images.img1} = 0

Details b:
Image2(a) | Image2(b)
Underlay Following Sections checked
Suppresion formula:
Code:
{images.img2} = 0
Image2(a) suppression formula:
Code:
{images.img1} = 1
Image2(b) suppression formula:
Code:
{images.img1} = 0

Details c:
Image3(a) | Image3(b) | Image3(c)
Underlay Following Sections checked
Suppresion formula:
Code:
{images.img3} = 0
Image3(a) suppression formula:
Code:
{images.img1}+{images.img2} > 0
Image3(b) suppression formula:
Code:
({images.img1}+{images.img2} > 1)
or
({images.img1}+{images.img2}+{images.img3} <= 1)
Image3(c) suppression formula:
Code:
{images.img1}+{images.img2} < 2

Details d:
Image4(a) | Image4(b) | Image4(c) | Image4(d)
Underlay Following Sections checked
Suppresion formula:
Code:
{images.img4} = 0
Image4(a) suppression formula:
Code:
{images.img1}+{images.img2}+{images.img3} > 0
Image4(b) suppression formula:
Code:
({images.img1}+{images.img2}+{images.img3} > 1)
or
({images.img1}+{images.img2}+{images.img3}+{images.img4} <= 1)
Image4(c) suppression formula:
Code:
({images.img1}+{images.img2}+{images.img3} > 2
or
{images.img1}+{images.img2}+{images.img3}+{images.img4} <= 2)
Image4(d) suppression formula:
Code:
{images.img1}+{images.img2}+{images.img3} < 3

Details e:
Image5(a) | Image5(b) | Image5(c) | Image5(d) | Image5(e)
Suppresion formula:
Code:
{images.img5} = 0
Image5(a) suppression formula:
Code:
{images.img1}+{images.img2}+{images.img3}+{images.img4} > 0
Image5(b) suppression formula:
Code:
({images.img1}+{images.img2}+{images.img3}+{images.img4} > 1)
or 
({images.img1}+{images.img2}+{images.img3}+{images.img4}+{images.img5} <= 1)
Image5(c) suppression formula:
Code:
({images.img1}+{images.img2}+{images.img3}+{images.img4}> 2)
or
({images.img1}+{images.img2}+{images.img3}+{images.img4} + {images.img5} <= 2)
Image5(d) suppression formula:
Code:
({images.img1}+{images.img2}+{images.img3}+{images.img4} > 3)
or
({images.img1}+{images.img2}+{images.img3}+{images.img4}+{images.img5} <= 3)
Image5(e) suppression formula:
Code:
{images.img1}+{images.img2}+{images.img3}+{images.img4} < 4


(It's been a slow day)

-dave
 
Looks like I also got something...
Let's think of a report in which 5 images placed vertically into a separate sections, the sixth section is blank. Now we suppress all sections except of one based on a report parameter... Now this report is placed as subreport 5 times side by side...Now we connect each subreport to formulas in main report to switch images...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top