Results 1 to 4 of 4

Thread: diferent images paths on a datareport

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    2

    Talking diferent images paths on a datareport

    i need to print some kind of ID Cards with diferents images (photos) on them, i'm using this code, but the same image is displayed on every record:

    Dim rs As ADODB.Recordset

    Set conn = New ADODB.Connection
    conn.ConnectionString = _
    "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & RutaBaseDatos & ";" & _
    "Persist Security Info=False"
    conn.Open

    ' Open the Recordset.
    Set rs = conn.Execute("select * from alumnos", , adCmdText)

    ' Connect the Recordset to the DataReport.
    Set DataReport1.DataSource = rs
    Foto = rs.Fields("NControl")
    Set DataReport1.Sections("Detalle").Controls("Foto").Picture = LoadPicture(RutaFotos & Foto & ".bmp")

    DataReport1.WindowState = vbMaximized
    DataReport1.Show vbModal

    rs.Close
    conn.Close


    any idea how to put diferent images, using paths.

  2. #2
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    Hi

    It is logical that you get always the same image.

    You send one time the RutaFotos & Foto to your DataReport. Where you update it? What is RutaFoto? Is it a Variable? There is for sure the problem. It seems to me a logical problem. How you saved the Images?

    I do this way:

    I create in my Table a field with the filename of the Img. Then I just connect always on runtime to the correct image.


    If you have more problems then attach the zipped code here.

    Franky

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    2

    Talking Crystal Reports

    using Crystal Reports instead, think is a better solution

    thanx for your help anyway

  4. #4
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    Hi

    For your simple problem it is maybe not nec. to use Crystal reports. I am even not sure for what you need the report itself. I create the most reports manually, specially when there are pictures in it.

    Franky

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width