?
Solved

data reports

Posted on 2004-08-20
4
Medium Priority
?
133 Views
Last Modified: 2010-05-02
Hi..

Can someone please help me on data reports in Visual Basic 6.0?

I have a table with a list of employees.  One of the field contains the filename for the image file (.JPG).  I created a data report with an Image control.  I want to be able to print out the employee with their picture in it.  The objective of the application is to print identification cards for all the employees in the table.   I am using one of those Avery business card papers to print the cards.

However, I can't seem to find the property that would allow me to assign value to the Image control.  I am able to show the Name and IDs but not the picture.  The image control allow me to specify a fixed file but not to dynamically assign a filename.

Please help..  I hope I was able to explain my dilemma clearly.

Thank you for all you experts out there.
0
Comment
Question by:winpiglet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 18

Accepted Solution

by:
JR2003 earned 2000 total points
ID: 11854116
The only way you can dynamically assign a picture to a report image is to do it once before you run the report.  This would mean that you have to run a report for each employee. It's probably not what you want but here it is anyway.

1) Add a new data report to your project
2) Draw an image control in the top of the report in the report header (section4)
3) Write a function in the report module:

Public Function LoadImage(sFileName As String)

    Set Me.Sections.Item("Section4").Controls("Image1").Picture = LoadPicture(sFileName)
   
End Function

When you run the report you'd do something like this:

Private Sub Command1_Click()

    With DataReport1
        .LoadImage "c:\a.jpg"
        etc...
        .Show
    End With
End Sub

You can only change the image once per run of the report.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses

777 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