CrystalDecision.CrystalReport - How to dispay an image from Blob field in MySQL using VB.NET?

Posted on 2004-11-30
Last Modified: 2009-12-16
Hi experts,
How can I display an image from a Blob field in MySQL on report through CrystalDecision.CrystalReport using VB.NET.
I have set up a report in VB.NET using CrystalDecision.CrystalReport. The report source is from one of the tables in a dataset. This dataset is updated during run-time. Data Type for the image in the dataset is hexBinary and the image is stored in MySQL with type mediumblob. Somehow all other fields in dataset are displayed on the report except for the image.
Please help!
Many thanks
Question by:LanAnh
    LVL 69

    Accepted Solution

    LVL 100

    Expert Comment

    Is the blob a bitmap?  Crystal only supports bitmaps that are stored that way.


    Author Comment

    Hi emoreau,
    The comments in the code mention about creating schema for designing the report. I can't view the schema in this example as it is no longer exist after the report is created. I'd like to know what is the data type in the schema equivalent to System.Type.GetType("System.Byte[]").
    I have included in my project a schema DatasetSource.xsd which have many tables for many other reports purpose. The table that hold the image (JPEG), I set the data type is hexBinary. In my code when I pass the table look like this:

    dsReport.Tables.Add(New DatasetSource.asset_generalDataTable)
    rs.Open(sqlMain, cnn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic)

    recordsetToDataset(rs, dsReport, "asset_general") 'other procedure to tranfer data from recordset to dataset


    Can you find any thing wrong? as the image is not shown in the report.
    Many thanks!

    PS. Thanks mlmcc.  I am investigating your info

    Author Comment

    Hi emoreau,
    I have found my problem in my procedure recordsetToDataset.
     row(i) = rs.Fields(i).Value
    I modified the code to readBytes when it read the column contains the image
    It works perfectly now.
    Thanks alot .

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Suggested Solutions

    Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now