-
Dec 20th, 2014, 08:03 AM
#1
Thread Starter
Fanatic Member
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.
-
Dec 20th, 2014, 02:59 PM
#2
Thread Starter
Fanatic Member
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?
-
Dec 20th, 2014, 06:47 PM
#3
New Member
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
-
Dec 21st, 2014, 07:08 AM
#4
Thread Starter
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|