Skip to Content
0
Former Member
Mar 24, 2014 at 06:00 AM

How to get picture in crystal reports from path?

366 Views

Hi,

i want to place picture in crystal reports from path.

Please check My coding below...

Dim ImgPath As String = objMain.objCompany.BitMapPath

[Note-here i declared Imgpath as path from SAP Here objMain.objCompany.BitMapPath is from SAPB1\Administration\Systemintialization\Generalsettings\Path\Picturesfolder]

Dim FileName As String = System.IO.Path.Combine(ImgPath, Img1.png) [Note-here img1.png is my img file]

Dim Picture1 As SAPbouiCOM.PictureBox

Picture1=FileName

RptVSDForm.Path1 = Picture1.Picture [Note-here RptVSDForm is my Form for crystal report and Path1 is string for getting Picture ]

Dim fs As New System.IO.FileStream(Path1, IO.FileMode.Open)

Dim br As New System.IO.BinaryReader(fs)

Dim imgbyte(fs.Length) As Byte

imgbyte = br.ReadBytes(Convert.ToInt32((fs.Length)))

oDt.Rows.Item(oDt.Rows.Count - 1).Item("CompanyLogo") = imgbyte [Note -here Company logo is my Database field to display Picture]

br.Close()

fs.Close()

but am not getting picture in crytal reports ....there is no error but am not getting picture in crytal reports....i think i need to link picture1 which i declared in above code to Path...i need help to solve this problem...

Please Help mr to Solve this problem...

Thanks & Regards,

Kamalaker