Solved

How print pictures on a report

Posted on 2014-04-03
17
333 Views
Last Modified: 2014-04-08
I have a report that uses a query as it's record source.  The key field in the query is "PartN" which is a number field.  The the report has a field named "txtPartN".

There are jpg picture files in a directory that reside in a folder that has the same name as the key field on the report.  The path to the pictures folders is for example:  C:\CompanyNameNCMRPhotos  -  This path is entered in a table named tblSetup in a field named "PicturesDataPath"

So for example, if PartN on the report is "9999" then there is a folder in that path named "9999" and I need to print the pictures that are in that folder on the report.  In some cases there may be 1 picture.  In other cases more than 1 picture.

How can I do this?

--Steve
0
Comment
Question by:SteveL13
  • 10
  • 7
17 Comments
 

Author Comment

by:SteveL13
ID: 39978106
Just checking... has anyone had a chance to review this topic for me?  I'm really stuck on this one.  Hopefully I explained it well.
0
 
LVL 30

Expert Comment

by:hnasr
ID: 39978139
May you attach a representative sample database, with just few records and pictures.
0
 

Author Comment

by:SteveL13
ID: 39978221
Ok.  Please see attached.  I've included a stripped down version of the database along with two folders that were created with the label on the form.  When the late on the form is clicked the system creates the folder that is named the same as the key number of that record.

So if you:
1) Open the database.
2) Select 20001 from Existing Records
3) Preview Report.
4) I want to see the three images that are in folder 20001 at the bottom of the report.

If you select 20000 then only one image should print since there is only one image in folder 20000.

I hope this makes sense.

--Steve
Sample.zip
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:SteveL13
ID: 39978229
One additional thing.  I would like the pictures to appear three across in a row.  So if there are 3 pictures they'd appear in one row.  If there was just one picture it can be in the first position.  If there were, say 5 pictures, they would appear in two rows.

Make sense?
0
 

Author Comment

by:SteveL13
ID: 39978271
Correction:

If there is only one picture it should appear centered on the report but be no deeper than a one page report allows.  If there are two pictures they should appear side-by-side but again, no deeper than a one-page report would allow.  If three pictures then they are to appear side-by-side in one row.  In other words, the pictures need to resize on the fly.

Complicated!!!
0
 

Author Comment

by:SteveL13
ID: 39978332
Sorry.. one additional correction.  There will only be a maximum of three pictures per primary key.

So no matter how many pictures, 1 to 3, they should be centered on the page in one row.
0
 
LVL 30

Expert Comment

by:hnasr
ID: 39978395
Tell me step by step, what to do to demonstrate the issue,

Please limit your question to one problem.

Are you able to display images? If not then this is one issue.
Formatting the display of more than one picture is another issue, and can be dealt with in another question.
0
 

Author Comment

by:SteveL13
ID: 39978404
Ok.  I'm sorry.

For the first question then I just want to know how to...

I have a report that uses a query as it's record source.  The key field in the query is "PartN" which is a number field.  Then the report has a field named "txtPartN".

There are jpg picture files in a directory that reside in a folder that has the same name as the key field on the report.  The path to the pictures folders is for example:  C:\CompanyNameNCMRPhotos  -  This path is entered in a table named tblSetup in a field named "PicturesDataPath"

So for example, if PartN on the report is "9999" then there is a folder in that path named "9999" and I need to print the pictures that are in that folder on the report.  In some cases there may be 1 picture.  In other cases more than 1 picture.

How can I do this?


(I'll post another topic regarding formatting on the report after this one is figured out).

--Steve
0
 
LVL 30

Expert Comment

by:hnasr
ID: 39978457
Sorry SteveL13,

Still unable to  follow.

I have the images in 2 folders.

Now, can you remove any object not relating to the issue. For example, leave one table, one report and one form.
Show an image of the expected output.
0
 

Author Comment

by:SteveL13
ID: 39978539
I stripped everything I can and have attached a file.  Also in the zip file is a jpg file that shows what I would like the report to look like using #20001.
Sample2.zip
0
 

Author Comment

by:SteveL13
ID: 39980086
Good morning.  Just checking in.  Did I explain the task well enough in my last post or am I still doing something wrong?  Or maybe this just can't be done?
0
 
LVL 30

Expert Comment

by:hnasr
ID: 39980554
SteveL13,
Trying to do something. I tried with a copy of your report but was not successful.
Created a new report rep, using 2 tables: tbl1, pLink.
Please check and comment.
Sample2.zip
0
 

Author Comment

by:SteveL13
ID: 39981490
I just tried to run the sample 2 Access file and the report isn't working.  Am I doing something wrong?
0
 
LVL 30

Expert Comment

by:hnasr
ID: 39981756
I see the problem.
Modifying the report.

Try this modified version.

Images pictures set to D:\Sample2\0.jpg

If you change path modify Picture property.
Sample2.zip
0
 
LVL 30

Expert Comment

by:hnasr
ID: 39981810
Waiting your comment.
0
 

Author Comment

by:SteveL13
ID: 39982932
Still when I open the form "frmNCMR" and click [Preview Report] I see no pictures.  I must be doing something wrong.
0
 
LVL 30

Accepted Solution

by:
hnasr earned 500 total points
ID: 39983300
So, the status now is:
Report works when opened directly in Print Review.
Not showing images when run from form.

You need to use the relevant report name: In this case it is rep.
Try this sample.
You need to maintain on close event.
Sample3.zip
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Reference theme colors in VBA 4 24
Search for text in a .txt file 14 41
Access check if a table is open 4 39
DCount Type Mismatch 2 21
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now