I am building a small project that saves some data about persons including their photo. I am using access database for portability reasons. I created a crystal report that i want to use to display the data of a person as a print feature.
This is the code that generates the crystal report.
Private Sub Button9_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
Form9.Show()
Dim ds As New DataSet1
Dim cnn As OleDbConnection
Dim connectionString As String
Dim sql As String
connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" & Application.StartupPath & "\Database.mdb; Jet OLEDB:Database Password=;"
cnn = New OleDbConnection(connectionString)
cnn.Open()
sql = "SELECT eponimo, onoma, Photo FROM ImageTable"
Dim dscmd As New OleDbDataAdapter(sql, cnn)
dscmd.Fill(ds, "ImageTable")
MsgBox(ds.Tables(1).Rows.Count)
cnn.Close()
Dim objRpt As New CrystalReport1
objRpt.SetDataSource(ds.Tables(1))
Form9.CrystalReportViewer1.ReportSource = objRpt
Form9.CrystalReportViewer1.Refresh()
End Sub
My problem is that i dont know how to get the photo from the database and display it in the crystal report. I dont want to do it using the wizard because later i want to show only a specific photo of the choosen person and not all the photos.
Any idea how can i take the photo and put it in the place i want in the crystal report?
Thanks in advance!

New Topic/Question
This topic is locked




MultiQuote



|