Topic: Tinkering with BLOB field / image file Posted: 29 Jul 2008 at 1:38pm
I'm trying to use Crystal Reports XI with an Oracle database. The database itself is a commercial product with a Uniface front-end, but the vendor provides read-only access so that we can use third-party tools to supplement their canned reports.
My problem lies in getting images out of the database. The images are stored in BLOB fields. But they don't work with CR, in spite of the BLOB support.
I've now been told that when the raw image data is stored it gets preceded by a #. They also sent me some sample Cold Fusion code that strips in and then displays the file (i.e. prints the raw data as an "image/jpeg" mime type).
I think it would be straightforward to do the manipulation of the data in a CR custom function, but I can't figure out
a) can I get CR to dump the raw contents of the BLOB into a variable or array that I can then manipulate in a function?
b) having done that, can I then get the data displayed on the report?
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Posted: 29 Jul 2008 at 2:42pm
Unfortunately, there are no provisions in Crystal itself for manipulating blob fields. However, you might be able to use a command instead of the tables to do this. A command is a SQL statement that you enter for Crystal to use instead of selecting tables and linking them.
Also, is it possible to insert the image by URL, but construct the URL on the fly with a formula? (With my current skill set I'd get it done faster writing a CGI in perl to return the image on the fly via HTTP than by doing it in SQL or visual basic (which I assume would be another way around).
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Posted: 30 Jul 2008 at 8:10am
You might be able to - I've not tried this.
1. Insert an Image on the report (don't drag the blob field - go to the Insert menu.)
2. Right-click on the image and select Format Graphic. Select the Picture tab and click on the "x-1" button by Graphic Location. Type in your formula here. Click on Save and Close.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum