I have a table of employees in a mysql database and a blob field in that table that stores a picture of each employee. Some of the employees don't have a picture so that field is null. When I built a crystal report in Visual Basic showing those pictures for each employee, instead of showing nothing for the null ones, I want to display an image that says "no photo available". I put code in the .dsr file under the details event to check whether the field is null or not like so...
Private Sub DetailSection1_Format(ByVal pFormattingInfo As Object)
If IsNull(photoFile.value) Then
NoPhotoAvailable.Suppress = False
Else
NoPhotoAvailable.Suppress = True
End If
End Sub
The problem is that it doesn't read the value properly because the if value always returns "empty". I tried to find a property of the photoFile object that would read the value but the only one that I thought might work was the .field property. So I changed the code like so...
Private Sub DetailSection1_Format(ByVal pFormattingInfo As Object)
If IsNull(photoFile.field) Then
NoPhotoAvailable.Suppress = False
Else
NoPhotoAvailable.Suppress = True
End If
End Sub
This didn't work either. Does anyone know what I'm doing wrong?
Private Sub DetailSection1_Format(ByVal pFormattingInfo As Object)
If IsNull(photoFile.value) Then
NoPhotoAvailable.Suppress = False
Else
NoPhotoAvailable.Suppress = True
End If
End Sub
The problem is that it doesn't read the value properly because the if value always returns "empty". I tried to find a property of the photoFile object that would read the value but the only one that I thought might work was the .field property. So I changed the code like so...
Private Sub DetailSection1_Format(ByVal pFormattingInfo As Object)
If IsNull(photoFile.field) Then
NoPhotoAvailable.Suppress = False
Else
NoPhotoAvailable.Suppress = True
End If
End Sub
This didn't work either. Does anyone know what I'm doing wrong?