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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Place Letter Head Image from path in table in Report Header sec

Status
Not open for further replies.

DPROMICS

Technical User
Nov 5, 2003
108
US
How to Place Letter Head Image from path in table in Report's Header section

OK, I have asked this before. But all of the posts have not helped me figure out how to do what I really need to be able to do. May be I just didn't ask my question clearly enough last time. So let try it again.

What I need/want to be able to do is:

I want the Letter Head Image of the medical practice, saved in a TIF format, to be displayed in the Report's Report Header section. The idea being that if the Letter Head changes because a doctor leaves or comes in to the practice
only the Letter Head Image file has to be changed. NOT THE HEADER SECTION OF EVERY REPORT.

Why Tiff? Because it looks better when displayed/printed than a JPG does. May be its the printer, its Window's driver, or ? The graphic image file format shouldn't matter to Access though.

OK, Here are the details.

The application is being developed in Access 2000.

There is a Table, we will call it: Tbl_Customer_Demographics.

The table doesn't have an index because it contains the business' demographic data like name, address, telephone number, etc. It also has an entry that contains the path (as a text string) to where the Letter Head Image file is
stored.

The idea is that not every installation of the Access app will be in C:\Propgram Files\<Access App name>. The Access app could be on a peer-to-peer network or a network with a file server where the Access app is stored on a PC's or a Server's hard drive but run on a user's PC. In either case the path to the Access App and the path to the Letter Head Image file will not be C:\<something>

Now the Report gets its data from a Query against tables in the database. We will call the Query: Qry_Report_Patients_Over_Due_For_Clinic_Visit. In the Query's SELECT section we will get the path to the Letter Head Image file from the table: Tbl_Customer_Demographics entry called: Letter_Head_Image_Path and the data for the report from some other tables in the app's database.

The Query. Well the pertinent parts of it anyway.

SELECT E.Letter_Head_Image_Path, D.PT_DB_Number, C.PT_DB_Number,
D.PT_Name_Last, D.PT_Name_Prefix, D.PT_Name_First, -- etc.--

FROM Tbl_Customer_Demographics AS E, Tbl_PT_Demographics AS D INNER JOIN Tbl_Coumadin_Clinic AS C ON D.PT_DB_Number=C.PT_DB_Number

WHERE (((D.PT_DB_Number)=[Forms]![Frm_ECMR_Main]![TBo_PT_DB_Number]) AND
((C.Clinic_Visit_Date)=(SELECT Max(Clinic_Visit_Date)

FROM Tbl_Coumadin_Clinic WHERE PT_DB_Number = C.PT_DB_Number)));

Now in the Report called: Rpt_Patients_Over_Due_For_Clinic_Visit, in the Report
Header section the actual Letter Head Image should be displayed.

The Conceptual Diagram.

Query Table

Looks up path in Table <--- Path to the Letter Head
Image file
|
|
V

Report

Report Header section

Letter Head Image

Report Details section

Data retreived by Query from other tables

If I put a text box in the Report Header Section when the report is run the path from the table entry is displayed. So the query is doing what it is supposed to do.

However, I haven't been able to figure out how to put an Image "box" in the Report Header section and have the Letter Head Image from the path in the
Tbl_Customer_Demographics to where its actually stored, be displayed when the report is run.

This sort of capability would be very useful for Access developers that can modify what they have developed for use by multiple customers.

Somebody on this forum must have figured out how to do this already.
 
Have you embedded an image in the report header?

If so, then in the OnOpen event of the report run your query, get the path and then set the Image value.

I don't have a copy of Access on this PC, so I can't test that, but that's what I would do in any other programming language, and I don't see why it wouldn't work in Access.


Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for database developers:
The Fundamentals of Relational Database Design
Understanding SQL Joins
 
Lespaul,

All of the reports (12 reports so far) still have the actual Letter Head text in a text box and a logo in an image box in the report's Header section.

I have put the actual image of the medical practice's Letter Head in one report to test how it would work out and was going to do that for all of them. As a test I also set it up as a link to the image file which worked as well andd was going to use that method instead of enbedding the image in the reports.

Then I realized that physicians can and do come and go rquiring the Letter Head Image to be updated and that the Letter Head image file probably won't be at C:\<path> at every place that the program is installed.

"If so, then in the OnOpen event of the report run your query, get the path and then set the Image value."

The query runs when the report starts because in the report's properties box teh query is set as the source. Its not in a function called (triggered?) when the report is run.

Do you have an example of the function's code to do that? My creative programming skills are a bit rusty. If I can see the code - general idea of how to do it, I can then usually figure it out and make it work, sometimes through a bit of trial and error, for my app.
 
Ok, maybe I'm not getting this. You have a SINGLE image file stored somewhere on your network that is the letterhead that should be on EVERY report. When a doctor leaves the old image is replaced with a new image.

So, if I have an image \\servername\foldername\filename.tif then in the OnOpen of the report I would do something like:
Code:
ReportName.ImageArea.Image = \\servername\foldername\filename.tif

Again, they just did a license reconciliation and I no longer have Access on this PC so I can't CONFIRM that this will work, but it seems reasonable...I will look when I get home and see....have you tried posting this in Forum703?

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for database developers:
The Fundamentals of Relational Database Design
Understanding SQL Joins
 
lespaul,

You have the concept correct. There is a SINGLE Letter Head image file stored somewhere on the network that is the letterhead that should be on EVERY report. When a doctor leaves and/or a new one comes in to the practice the old Letter Head image is replaced with a new Letter Head image.

This capability wouldn't be limited to a medical practice. A legal practice might have the same need. Also, an app that can be used by multiple companies could also use this technique because obviously each company would want their own unique header on the app's reports.

The Letter Head image file may not necessarily reside on a server. In a peer-to-peer network the Letter Head image file would reside on one pc where the Access App and its database reside. The other PCs run the Access app from the one PC. The latter would also be true in a server based environment as well.

The other PCs in a peer-to-peer network would see the Access App'sLetter Head image file at: <some logical drive letter>/<path>

I didn't think to post this on the Microsoft: Access Reports forum. I should try that. But, I think the site "moderators" frown on posting on multiple forums in the same "class" i.e. Access.
 
Have a look here:
thread702-289543

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
It is often a good idea to reference the thread that did not resolve your problems, that is thread181-1384505.
 
OK Guys/Gals,

PHV - At that thread I couldn't get anywhere with the suggestions. Looking back at the thread again, there is one entry that I may have missed or misunderstood that is promissing as a possible solution to what I want to be able to do.

Now, that I have some time to get back to this Freebee (1,000 some hours so far on it) project's current problem to figure out, I'll just have to work, struggle(?), on it until I figure it out and get it working. Then I'll find it was so simple a solution that I will have to give myself a "Dope Slap". ;>)

I was hoping that some body had figured this all out already. Guess not. When I figure it out I'll post the solution here in this thread thread181-1384505: How to display image on report from path to image stored in a table and the other thread thread702-289543: Picture in my report mentioned..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top