Click here to Skip to main content
15,913,104 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all experts,
I have designed crystal report on vb.net already and i want to display the picture on my item to that report. i dropped Picture Control on CR and i try to find the property of this control to set the picture path from database but i don't see it. Does anybody know about this?
Note:
- I use Visual Studio 2008
- CR Version 2008

Thanks

TONY
Posted

1 solution

Hi,

you need to add image column (byte[]) to the table, add the column to report, (not Picture control, but field) :

VB
data.Tables(0).Columns.Add("img", System.Type.GetType("System.Byte[]"))

' fill the table with pictures from database or file system
'...
'...

' create a report
Dim cr As New CrystalReport1()

' pass a dataset  to a report 
cr.SetDataSource(data.Tables(0))

' pass a reportdocument to the viewer
CrystalReportViewer1.ReportSource = cr


Where "data" is your dataset.
 
Share this answer
 
Comments
soeun tony 26-Mar-13 23:25pm    
Hi Raimis9,
Thanks for ur reply. The path of image already store in database ( I have other application and that application store path of image only). So it means that i don't build application by myself but i can create CR and insert to that application.

TONY
Raimis9 27-Mar-13 3:56am    
CR can't load and show image by file path only.

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