Results 1 to 7 of 7

Thread: Print image on data report problem

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Print image on data report problem

    I have problem here, I want to print all image on database. When I try that code and navigate the the data report during run time, only text change but the image still don't change, It should change the image according the record. Why?

    Code:
     ' On the form
    ''Print all record
    Unload Me
    frmMenu.Picture2.Cls
    frmMenu.Picture2.AutoRedraw = True
    frmMenu.Picture2.ScaleMode = vbPixels
    On Error GoTo error:
    frmMenu.Picture2.PaintPicture LoadPicture(Pesttable.Fields("Gambar")), 0, 0, 200, 200
    
    Set reportperosak.DataSource = Pesttable
    reportperosak.Show

    Code:
    Private Sub DataReport_Initialize()
    On Error GoTo error
    'show the image from database to prit the form
    'Set Me.Sections("Section1").Controls("Image1").Picture = LoadPicture(Pesttable.Fields("Gambar"))
    
    'scale image from the image on formMenu to display on image in datareport
    Dim oPic As StdPicture
    Dim oImgControl As RptImage
    Set oPic = LoadPicture(Pesttable.Fields("Gambar"))
    Set oImgControl = reportperosak.Sections("Section1").Controls("Image1")
    
    oImgControl.SizeMode = rptSizeStretch
    oImgControl.Width = frmMenu.ScaleX(200, vbPixels, vbTwips)
    oImgControl.Height = frmMenu.ScaleY(200, vbPixels, vbTwips)
    
    Set oImgControl.Picture = oPic
    
    error:
    
    End Sub
    Attached Images Attached Images  

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