Showing results for 
Search instead for 
Did you mean: 

Disable selective fields in Crystal Reports - Image Field

Former Member
0 Kudos

Development Environment: VS 2005 Pro

Language: Visual Basic 2005

I have the following [template |]generated for my reports and I want to figure out how to disable the "photo or image" field in the page footer, if image data is not provided.

The main pieces of code I am using to insert the image into crystal reports from my form are as follows:

' Add data into the dataset
ds.DataTable1.AddDataTable1Row(id, GetImageData(ofdImage.FileName), userName)

' GetImageData function
    Private Function GetImageData(ByVal fileName As String) As Byte()

        Dim fs As System.IO.FileStream = New System.IO.FileStream(fileName, IO.FileMode.Open, IO.FileAccess.Read)
        Dim br As System.IO.BinaryReader = New System.IO.BinaryReader(fs)
        Return (br.ReadBytes(Convert.ToInt32(br.BaseStream.Length)))

    End Function

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:

Former Member
0 Kudos

What about

If IsNull(FieldName) or FieldName = ''

and also check the suppress blank section.


Former Member
0 Kudos


Here is a [snapshot |]of my setup and the error I am getting now.

I also get an error stating "A blob field cannot be used in a formula"

Please assist.

Edited by: Jerry Zacharias on May 27, 2009 4:14 PM

Former Member
0 Kudos

i gather the image has an id associated with it , or a name.

is the name or id null if there is no image, if so supress the section if isnull(field)

that may work for you

Former Member
0 Kudos


Sorry for the delay, somehow the "watching got turned off".

What you suggested did not work. It continues to leave huge "empty spaces" in my exported excel report.

Any other suggestions?