IM USING VB.NET - SQL AND CRYSTAL REPORTS
I'm trying to display an image into a crystal report's report but the image is displayed 20 % of the time, sometimes it works sometimes it doesn't.
Here is my Code: This is how I pass the parameters to the Crystal Report.
Dim ds As New MyDS
ds.Tables(0).Rows.Clear()
All of the variables are strings and the Image ones are string Paths like this: C:\folder1\folder2\image.jpg
ds.Tables(0).Rows.Add(date, timeIn, timeOut, Load, noTrailer, noBox, seal, coment, nameDriver, company, plates, oficial, imagen1, imagen2, imagen3)
Dim cr As New MyReporte
CrystalReportViewer1.ReportSource = cr
cr.SetDataSource(ds.Tables(0))
Here is how I add the image to the Crystal Report:
1.- Add an image to the report (Insert | Picture) as a place holder (I picekd a green circle).
2.- right click image
3.- select Format Graphic…
4.- select Picture tab
5.- click the conditional-formula button (looks like x+2)
6.- set the formula’s text to the name of the formula or parameter field that contains the image’s URL
7.- save the formula and click the OK button
8.- Save the report
Also, I added to the report the 'image' string to see if the path is correct.
1.- Here is the code of the image in crystal reports
2.- Here is how it looks in designer mode
3.- Here is the way it looks once I run the report for a specific row in the db
Notice how in the last image the links I'm sending to the report through the dataset are correct: "z:\folder1\folder2\folder3(name of this folder is the id of the row in the DB)\name of the image.jpg"
Also, the image displaying in the last image is the green image I used as place holder instead of the image in the path I sent.