[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

data reports

Posted on 2004-08-20
4
Medium Priority
?
134 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

650 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