Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How add picturebox in Crystal Report? I using C# - VS 2008
Posted

we can easily insert picture in crystal report from file location in database.

1. Create a data set, create a data table and add columns you need in crystal report. add a column for your image. eg:- MyImage and give datatype as System.Byte()

2. Open crystal report and set data set as report source.

3. Give the following code in button click

Dim lFSFileStream As FileStream
 Dim lBRBinaryReader As BinaryReader
 Dim lBImageByte As Byte()

 lFSFileStream = New FileStream(FilePathFromDataBase, FileMode.Open)

 lBRBinaryReader = New BinaryReader(lFSFileStream)

 lBImageByte = New Byte(lFSFileStream.Length + 1) {}


 lBImageByte = lBRBinaryReader.ReadBytes(Convert.ToInt32(lFSFileStream.Length))
 lFSFileStream.Close()




and set lBImageByte variable to data table column MyImage



4. drag drop MyImage item into report.



or visit on the link....

http://social.msdn.microsoft.com/Forums/en-US/29391a49-296a-47c1-ba70-0c2069a28a8d/printing-picturebox-image-in-crystal-report[^]
 
Share this answer
 
i have QR code generator, QRcode is in picture box, and i want add to crystal report...

No need DB...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900