Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display a picture in a report from DB

Status
Not open for further replies.

robert201

Programmer
Jul 18, 2007
80
TH
Hello,

VS 2005 & SQL 2005

Crystal Reports for Visual Studio 2005.

I have a database field called signature and is an image datatype (binary data).

I am trying to display that signature in a crystal reports.

The signature has been displayed properly in the database as I can display the signature into a picture box using a memory stream. So I know the picture is there.

I am using typed datasets.

In CR i have dragged the signature field on to the crystal report and when i hover the mouse over it comes up with BLOB field.

However, when I run crystal reports it doesn't nothing in that field.

Is something more I have to do to display a picture in crystal reports?

Many thanks,

Steve
 
I'm not sure but the Xtreme sample database (MS ACCESS)that ships with Crystal Reports contains a picture BLOB field in the Employee table.

Take a look and see if it helps. You can find its location from the Xtreme ODBC Data Source setup in the Data Source Administrator.
 
Thanks for the reply

I am pushing the data on to the report using typed Dataset.

What I have checked so far is the dataset table by going to the dataset designer in visual studio and on the datatable I click the signature field to make sure it is set to the right data type (System.Byte()). so that is correct.

I can display the signature on a windows form in a picture box. So it is in the database ok. But just won't display on the crystal report.

When I connect to sql server using OLE DB(ADO) and drag the signature field on to the report designer it displays the signature.

However, I am using typed dataset and there are getting filled correctly as the other data is still be displayed in the report, but not the signature.

Any idea would be most grateful, as I can't seem to solve this problem.

Many thanks,

Steve

 
Crystal Reports only supports the following data types:

String, Number, Currency, Date, DateTime, Time, Boolean, Memo and Picture (BLOB).

You can "see" what datatype Crystal "thinks" your picture field is by turning on the "Show Field Type" option in the Field Explorer. (Right Click andy field in the field explorer and click Show Field Type)

I'm guessing that the format you have your picture field in, isn't supported by Crystal.

Another method Crystal supports pictures is via Dynamic Graphic files.

The following is an excerpt from the Crystal Reports Help

A BLOB field is a database field whose data consists of Binary Large Objects—such as bitmap graphics, images, OLE objects, metafiles, and so on. Inserting a BLOB field into your report allows you to access these binary objects as you would other data types.

Note: Crystal Reports can also access BLOB objects by reference (that is, dynamically through a file path), so that you do not need to store the BLOB objects in your database. For more information, see To make a static OLE object dynamic.

In general, Crystal Reports allows you to access BLOB fields containing:

Device-independent bitmaps (DIB).
JPEG, TIFF, or PNG images.
In addition, if your data resides in a Microsoft Access database, then Crystal Reports enables you to report on BLOB fields containing OLE 1 and 2 objects and metafiles.

You insert BLOB fields as you would any other database field. For details, see To insert a database field.

A BLOB field object differs from other database field objects in that it offers options to control cropping, scaling, and sizing—just like an inserted picture or OLE object. To access these options, right-click the BLOB field object, select Format Graphic from the shortcut menu, and click the Picture tab.

 
Try base64binary in your dataset. Thats what I use (vs2003).
 
There is no such version as "crystal reports for VS 2005". Please go to help about and find out the version #.

In any version of crystal, if the picture is in the database itself, you can just drag the blob field onto the report canvas where you want it to display.

In crystal XI, you can display a picture by providing a path to the location of the picture file. As mentioned earlier, not all file types are supported.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
VS.NET 2005, built-in CrystalReports
SQL 2000 (field is image datatype)

Try >>> System.Byte() <<< in your dataset.

HTH, Marin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top