Results 1 to 4 of 4

Thread: How to assign a picture from DB to Crystal Reports document?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2012
    Posts
    616

    How to assign a picture from DB to Crystal Reports document?

    I need to add logo from database into Crystal Reports document header. Previously I defined a placeholder object as OLE object (ICROleObject) type. After that, I tried to connect that object with the form which calls CR document.

    Dim pic As CrystalDecisions.CrystalReports.Engine.?????
    pic= rpt.ReportDefinition.Sections(0).ReportObjects("picCR")

    Tried to change "?????" with every value which sounds acceptable (GraphicObject, PictureOblect), but without any result.

    The problem is that I can't assign picture as we do that with PictureBox control.

    pic.xxxxx = Image.FromStream(New IO.MemoryStream(DirectCast(dr.Item(5), Byte())))
    Last edited by Goshx; Dec 20th, 2014 at 08:55 AM.

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2012
    Posts
    616

    Re: How to assign a picture from DB to Crystal Reports document?

    to be more concrete, which property of ICROleObject I have to change if I want to put a new picture there?

  3. #3
    New Member
    Join Date
    Jul 2013
    Location
    Melbourne, Australia
    Posts
    13

    Re: How to assign a picture from DB to Crystal Reports document?

    cast it as a "PictureObject"
    The "PictureObject" is found in the CrystalDecisions.CrystalReports.Engine namespace.

    Sample:
    Dim pic = CType(rpt.ReportDefinition.ReportObjects("picCR"), PictureObject)

    you can even suppress the "PictureObject" if need be

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2012
    Posts
    616

    Re: How to assign a picture from DB to Crystal Reports document?

    Hmmm... as I remember I've found this answer searching via Google yesterday on :

    http://stackoverflow.com/questions/2...s-2008-version

    Either I didn't understand this solution correctly or it simply doesn't work, I don't know.

    I spent a lot of time during the last two days trying to solve this (at first sight) very simple problem but it is terribly complicated thing.

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