Results 1 to 5 of 5

Thread: showing Image by path on crystal report 8.5

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Location
    Saudi Arabia, Gulf side, Qatif
    Posts
    142

    showing Image by path on crystal report 8.5

    As I am searching many crystal report forum, I appreciate your help in answering the following as I have the same probelm, Please help....

    I have a database that has a text field that holds a string which is a file path to an image file. for example, the value of the field can be 'C:\logo.bmp'.
    I am looking for a way to use this path to show the actual image on the report. I am using crystal reports 8.5

    Thanks

  2. #2
    zemp
    Guest
    I can't remember how many forums and websites I searched before I was able to find the answer. I think it was bits from multiple sources that I was able to put together over two or more weeks.

    Eventually I found a method that works using VB and the Crystal reports RDC. If you are not using this setup then I don't have a solution.

    1. Place a picture box control and the field with the path to the image in the same section.
    2. In the Format section event of the report you use the loadpicture method of the picture control to give it the path to the picture.

    I don't remember the exact syntax right now (it's on my machine at work) but it is something like this.

    picture1.loadpicture field1

    Let me know if you are using the RDC and I will send you the correct syntax tomorrow morning.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Location
    Saudi Arabia, Gulf side, Qatif
    Posts
    142
    Thanks for your reply, However, I am using the OCX of the crystal report and not RDC, the command you mentioned is some thing like :
    Code:
    set picture1.loadpicture(path & picture name)
    the (path & picture name) you got it from the data base field string, unfortuintly I am looking for the command to use in the crystal report it self where I can pass the parameter from the VB just like passing the report title to the formula that I defined in the Crystal Report.

  4. #4
    Frenzied Member oh1mie's Avatar
    Join Date
    Sep 2001
    Location
    Finland
    Posts
    1,043
    oh1mie/Vic


  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Location
    Saudi Arabia, Gulf side, Qatif
    Posts
    142
    I followed the link you posted, however, I found the following code is little pit easer:
    Code:
            Dim iCount As Integer
            Dim Filenum As Integer
            Dim PicArray() As Byte
            Dim ptPicture As String
            ptPicture = "D:\ANTIQUEI.JPG"
            Filenum = FreeFile
            Open ptPicture For Binary As Filenum
            ReDim PicArray(LOF(Filenum))
            Get #Filenum, , PicArray()
    With ImageRecordset
           .AddNew
           .Fields("Picture").AppendChunk PicArray()
           .Update
        Close Filenum
    End With
    But unfortuinitly, I am still not satisfied, I am looking now to have the image link in the data base to the images folder rather than copy the image to the data base record which cause the table to grow in size.
    Looking for your help
    Many thanks

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