473,394 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Showing or hiding images in a report

I am trying to figure out how to show a different image on a report based on the results of a formula. Conditional formatting allows me to change text, but I want to be able to swap out an image based on a formulated result from the report.

I tried doing an event on the report header just to turn of the visibility of a test image, and can't even get that to work...lol

Any direction or ideas here?

fyi...the purpose is that if someone does well, they get a green symbol, ok=yellow, bad=red...that sort of thing.
Sep 10 '08 #1
3 1540
ADezii
8,834 Expert 8TB
Assuming the Image Control is named imgColor, the Text Box on the Report is named txtFormula, and the Graphics Files are stored in C:\Graphics, the following code placed in the Format() Event of the Report will load different Graphic Images into the imgColor Control for specific Formulas. Any Formula not meeting the criteria will show a Green Image. This should point you in the right direction.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2. Select Case Me![txtFormula]
  3.   Case "Formula_1"
  4.     Me![imgColor].Picture = "C:\Graphics\Red.jpg"
  5.   Case "Formula_2"
  6.     Me![imgColor].Picture = "C:\Graphics\Yellow.jpg"
  7.   Case "Formula_3"
  8.     Me![imgColor].Picture = "C:\Graphics\Purple.jpg"
  9.   Case Else         'All other Formulas
  10.     Me![imgColor].Picture = "C:\Graphics\Green.bmp"
  11. End Select
  12. End Sub
Sep 10 '08 #2
Thanks...it still isn't working though. Is it because I am using a standard image as opposed to some sort of control (bound or unbound)?

I even just put the code:

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)

Me![imgColor].Picture = "C:\Users\alanb.NETWORK\Pictures\red.JPG"

End Sub

And that didn't even swap out the pic. I am missing something really obvious I am sure.
Sep 11 '08 #3
ADezii
8,834 Expert 8TB
Thanks...it still isn't working though. Is it because I am using a standard image as opposed to some sort of control (bound or unbound)?

I even just put the code:

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)

Me![imgColor].Picture = "C:\Users\alanb.NETWORK\Pictures\red.JPG"

End Sub

And that didn't even swap out the pic. I am missing something really obvious I am sure.
Place the code in the Format() Event of the Report's Detail Section to load Images for each Record.
Sep 11 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: c.anandkumar | last post by:
Hi All - I have some problems getting a small piece of javascript working correctly for Firefox. Here is what I am trying to do - 1. I have a form (like a search form) 2. I have many groups...
2
by: NASAdude | last post by:
I'm working on a report that shows a lot of data, so I've set it up so it is 2-pages wide in landscape view for each record. ie: The report is 22" wide (less margins). On the left page there are...
3
by: Dirk Goossens | last post by:
Hi! I stored the file name and path of photos in a table with data from students and teachers. Is there a way to show the photos in a report or form? Thanks! Dirk Goossens Vrij Instituut...
1
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems...
1
by: lewindha | last post by:
Hi guys I am new to ASP and .Net. I am working a web app where some Crystal Reports will be incorporated. Right now I am trying to get a simple report with a bar graph to show up in a browser....
2
by: ashok.ponnusamy | last post by:
i am using crystal report in my aspx page. i am using stored procedure to generate the report. it's work fine and shows the result based on parameter input. but it doesn't show any reportviewer...
7
by: needin4mation | last post by:
Hi, I have an Access 2002 - 2003 database. I am using Access 2003. Whenever I link an image all it shows is the filename. Not the image. Other versions of Access can link the image just fine. ...
1
by: dosingh | last post by:
i've put this page together using asp, html, javascript amd flash. java passes a number of variables over to the flash file but the flash graph does not appear. The error which appears is...
1
by: agoodsoldier | last post by:
I have a floor plan image that I'd like to highlight different rooms on at various times. I've created outlines of some rooms, (eventually all rooms) and would like to be able to enter as text, room...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.