Solved

data reports

Posted on 2004-08-20
4
132 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 500 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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 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…

691 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