Crystal reports not showing blob images from dataset

Hello all,

I have a dynamically generated dataset with a tiff image base64 encoded in it.  I put the blob image into a reportdocument and it doesn't show up when I run the report.  I know the image is good because I can covert from base 64 then export to disk and the image will be there fine on the disk.  The app is in ASP.NET 2.0, CR 11 Developer.

XSD file looks like:
<?xml version="1.0" standalone="yes"?>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:element name="Table1">
        <xs:element name="Image1" type="xs:base64Binary" minOccurs="0" />
  <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="Table1" />

The code that loads the report looks like:

Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim dsCustoms As DataSet = CType(Session("sesCustoms"), DataSet)
Dim crCustoms As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim Mstream As New MemoryStream
Mstream = CType(crCustoms.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat), MemoryStream)
Response.Buffer = True
Response.ContentType = "application/pdf"
End Sub

The report is fairly plain.  I put the blob image in the detail area and make sure that "Can Grow" is checked.

So, what am i doing wrong?  What's going on?  How do I fix it?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

This is just a guess, but possibly Crystal can't handle the image format?  I would try putting a .bmp image and see if that works.  At least that will isolate whether the problem is the image or something else.
Kurt ReinhardtSr. Business Intelligence Consultant/ArchitectCommented:
I believe frodoman is right.  Crystal only displays .jpg and .bmp images (.gifs if you view the report in a DHTML browser, but there are limitations).

jfoutzAuthor Commented:
Well, the docs say that a tiff is an acceptable format, but it's not like it would be the first they were flat out wrong...  So, I was hoping you were right and did the conversion:

Dim x As MemoryStream = New MemoryStream(Convert.FromBase64String(dsResponse.Tables(0).Rows(0).Item(0).ToString()))
Dim y As System.Drawing.Image = System.Drawing.Image.FromStream(x)
Dim z As New MemoryStream
y.Save(z, System.Drawing.Imaging.ImageFormat.Bmp)
dsResponse.Tables(0).Rows(0).Item(0) = Convert.ToBase64String(z.ToArray)

I know the conversion worked because I can output it to disk and the image is there intact.  i.e.
My.Computer.FileSystem.WriteAllBytes("c:\tmp1\tmp1.bmp", z.ToArray(), False)

But...  still no image in my report.
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

jfoutzAuthor Commented:

Is there any other way to get images into a report without resorting to temp files?  As I understand, a dataset is the only way.
With CR11 you are supposed to be able to put the image file name in the field and Crystal will pull up the image.

Are you running a local application or is this a server application.  The image must be in the correct directory which may be the server or the client depending on how the application is run.

jfoutzAuthor Commented:
So I finally broke down and opened a case with Business Objects.

The problem turned out to be encoding…  Specifically, I was forwarding a base 64 string of the binary to Crystal, while Crystal will only accept a non-encoded byte array of the binary.  Of course the schema still had to specify that the field was a “xs:base64Binary” even though the data couldn’t be forwarded with base 64 encoding.  The other methods of sending data to Crystal such as an XML file can send a base 64 string no problem.  

I requested that Business Objects consider either allowing a dataset to send blob images as base 64 strings (since that’s how they generally exist in databases anyways) in future builds, or specify in the documentation that a dataset can only pass a blob image on as a non-encoded byte array.

Thank you to everyone who looked at this problem.
Closed, 500 points refunded.
The Experts Exchange
Community Support Moderator of all Ages

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.