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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BLOB field graphics don't display in Crystal

Status
Not open for further replies.

b2bnettools

Vendor
Jul 3, 2000
4
0
0
US
The is a repeat of a previos question which nobody was able to respond to. If anyone can help I would appreciate it.<br><br>I can't get Crystal to display a graphic that is contained in SQL 7 in a blob field.<br><br>In SQL 7 in the PUBS database (which is installed as a part of SQL 7, I guess for examples) there is a table called PUB_INFO and inside of it a field called LOGO. There are several company logos - and I have seen in the documentation what they are supposed to look like.<br><br>If you create a new report in Crystal using the standard report wizard, and add only one field which is the LOGO, and then hit preview, Crystal starts a report - but the field isn't there in the details. You can add it in by doing and &quot;Insert, Database field&quot; and then all you get is the 1 inch box. You can see that the report prints the appropriate amount of data records corresponding to the actual records in the table, but the BLOB field graphic data is not displayed.<br><br>I have also tried connecting through ODBC rather than the Crystal SQL Server connection - same result.<br><br><br>
 
Hi !!<br><br>Try to do it with Crystal Version 8<br><br>I had the same problem using Oracle 8.05 and Crystal Reports 7.0; I was using blob fields in Oracle and the same fields were defined as blob in Crystal , but it doesn't work; then I moved to Crystal 8.0, and in Oracle I used the the field type Long Row instead the blob and it works.
 
I will go out and buy a copy of Crystal 8 since I intended to anyway, but the original post describing the same problem that I concurred with on this forum stated they were working with Crystal 8 (I have 7).<br><br>I am curious about the changing of the data type at the same time. The only binary type of data field in SQL Server that can have a size greater than 8000 bytes is an &quot;image&quot;.<br><br>Does Oracle have an additional type of long binary field?<br><br>Thanks
 
I had the same problem, the solution occurred to me after reading another post from someone who got it to work with BMPs but could not with JPGs or GIFs.

Since I was storing image data only from JPG files (which are smaller), I tried storing binary data from BMPs instead and it worked. For confirmation, I tried storing some BMPs and some JPGs and Crystal Reports only displayed the BMPs.

I have only tested this using an ODBC connection to SQL Server 7 (it should work with other ODBC sources)
 
And how to get the image itself into the SQL database (SQL 2000)?
 
To get the image in the SQL image (large binary) field, write the following in query analyzer (anything between - - is a remark, anything between <> should be replaced with actual table,field etc names):
-First, create a record with a dummy value for the binary field. The value shown here is a good choice-
insert into <tablename>
(<fieldname1>,<fieldname2>,...,<imagefield>)
values (<value1>,<value2>,......,0xffffffff)
-Then, insert the actual binary value of the picture you want to store in the field-
declare @Pointer varbinary(16)
select @Pointer = textptr(<imagefield>)
from <tablename>
where (<fieldname1>=<value1>) -this is to select the correct record for the picture-
writetext <imagefield> @Pointer
'<picture's full path>'


 
I have the same problem with blob fields in crystal 9. I am trying to preview a blob field from sql server 2000 (image data type) and cannot get it work. I've tried to insert all types of formats for pictures in the binary field (bmp,tiff,gif) and of all sizes (over and under 7kb - remember that sql server stores images smaller than 7kb in the image field itself whereas it stores a pointer for the picture in the field if it's larger than 7kb, and stores the actual picture elsewhere), but none of them previews in crystal. I also tried updating crystal with several hotfixes suggested by seagate (cr90mainwin_en.zip, cr90dbexwin_en.zip), but none of them fixed the problem. If anyone has any suggestions, please post. Thanx, word.
 
Good news everyone, I managed to work with jpg pictures stored in an image field on sql server, and succesfully previewed the blob field in crystal 9.0 without using image conversion code or any other app. The thing is you have to load the pic in the image field not through T-SQL but through a utility that comes with SQL server called BCP. It's got a bug though, so you have to follow certain instructions specified in the microsoft knowledge base article 271344
( Hope this comes in handy, grelunaz sgning out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top