Page 1 of 1

[Solved] Database stored images in Oracle reports

PostPosted: Sun Apr 01, 2018 5:33 am
by lewisbarry92
Hi All, I have a quick question...

I have a little database, in it, I have a table where I store a few images. I'm building a report where I would like to display these images along with some other data also stored in the same table.

Is this possible?

I'm not talking about inserting a static image into the header or the footer as a logo of sorts, I'm talking about pulling an image into the report same as pulling a stored birthday or name field.

Currently, my Oracle Report pulls the image field from my table (view), converts it to a formatted text field and displays a "0" in the image field when I run the report. I did a quick test, trying to pull the image field directly from the table rather than the view, but it made no difference.

Thanks in Advance,

Barry

Re: Database stored images in Oracle reports

PostPosted: Sun Apr 01, 2018 6:41 pm
by longi
Hi!
I've just tried it in a database I made some time ago with some images and ORB gets them properly.
Maybe we need more specific information or a little example.

Bye! ;)

Re: Database stored images in Oracle reports

PostPosted: Sun Apr 01, 2018 6:48 pm
by F3K Total
Hi,
for internal and external images, i don't see any problems as well. The internal version will be corrupt after adding some more pictures. I would prefer the external version.
Find an example attached.
R

Re: Database stored images in Oracle reports

PostPosted: Sun Apr 01, 2018 7:31 pm
by UnklDonald418
I tried both data sources, a table and a view and had no problem displaying embedded graphics objects on an ORB report.
Currently, my Oracle Report pulls the image field from my table (view), converts it to a formatted text field and displays a "0" in the image field when I run the report.

If you don't have an Image Control in the details area of your report form the use Insert->Report Controls-> Image to add one. Select the Image Control you just added and looking at the Data tab in the Properties dialog select the name of your image column from the list in the Data Field property.

Re: Database stored images in Oracle reports

PostPosted: Sun Apr 01, 2018 8:15 pm
by lewisbarry92
UnklDonald418 wrote:If you don't have an Image Control in the details area of your report form the use Insert->Report Controls-> Image to add one. Select the Image Control you just added and looking at the Data tab in the Properties dialog select the name of your image column from the list in the Data Field property.


Hi UnklDonald418!! Good to see you again! I don't have the path: Insert -> Report Controls -> Image I have instead: Insert -> Report Controls -> Graphic

It does add and image control field to the detail section, I selected the name of the image column and everything looks cool. But, now when I run the report, nothing shows up....the "0" isn't there. Another, quick, stupid question. What image types, i.e. JPEG, PNG, BMP, etc. are allowed? I'm using JPEG's at the moment, cause that's what I had handy. Could this be the problem?

Re: Database stored images in Oracle reports

PostPosted: Sun Apr 01, 2018 9:13 pm
by Villeroy
Why do you attach a picture instead of the database document?
And why do you embed the picture in a text document?
Bizarre.

Re: Database stored images in Oracle reports

PostPosted: Sun Apr 01, 2018 9:15 pm
by UnklDonald418
I used .jpg files in my tests. Here are screen shots of both the Data and General tabs of the properties dialog on my little test report.

In the long run, the approach that F3K Total uploaded is the best way.

Re: Database stored images in Oracle reports

PostPosted: Sun Apr 01, 2018 9:53 pm
by longi
Those pictures don't permit me to figure out what the problem is.
Maybe the problem is based on the way they had been inserted in the database table and it is not an ORB problem.

Re: Database stored images in Oracle reports

PostPosted: Mon Apr 02, 2018 1:21 am
by lewisbarry92
longi wrote: Maybe the problem is based on the way they had been inserted in the database table and it is not an ORB problem.


This image thing should be a no brainer. I have the image control in the report and it is set up exactly the same as UnklDonald418 showed. It's just not working. I have a form, that I created in AOO that inserts all the data into my tables. Everything works great, images are stored and retrieved in the form flawlessly. :crazy:

Re: Database stored images in Oracle reports

PostPosted: Mon Apr 02, 2018 1:42 am
by UnklDonald418
Have you tried creating a new report using the Wizard?

Re: Database stored images in Oracle reports

PostPosted: Mon Apr 02, 2018 1:49 am
by lewisbarry92
Yeah I tried that....
a quick question....I just noticed that my image is stored in the table as a BLOB rather than the IMAGE datatype. Remember, I copied and pasted the table into the new split database. It looks like it changed the datatype....could this be it?

Re: Database stored images in Oracle reports

PostPosted: Mon Apr 02, 2018 2:39 am
by UnklDonald418
Ok, NOW I see your problem. Apparently, we were all using Embedded databases for our tests, but somehow, ORB doesn't know what to do with embedded images in a Split database. However, you can use the linked images like F3K Total showed in his example.
Add a text field to your database to store the URL of your image file. On your form use the text field as the Data Source for the Image control and then you can store the URL in the text field using Insert graphics from.
If you are using a View as the data source for your report you may need to edit the View to include the new text field. Now, if you use the text field as the Data Field on the Image control in your report it should display the image.

Re: Database stored images in Oracle reports

PostPosted: Mon Apr 02, 2018 3:43 am
by lewisbarry92
OK...now we're getting somewhere. I just really hoped that it was something stupid I was missing. I'm planning on a picture database down the road a ways where I will utilize the approach just outlined by you and F3K Total. For now, I'll make the changes to store the URL as well and give it a go, and let you know how it turns out.

Thank you to everybody for their input!
Barry

Re: Database stored images in Oracle reports

PostPosted: Mon Apr 02, 2018 5:06 am
by lewisbarry92
Yippee! Storing the URL worked! My images are now showing up in my report!! I'm still going to save the image in the db as well as the external file, in the hope that someday storing images in the split db will work like the embedded db does.

I have one more questions...
Where is the best place to store the images folder with regard to the split database configuration and portability of the whole app.

Re: Database stored images in Oracle reports

PostPosted: Mon Apr 02, 2018 5:28 am
by UnklDonald418
I only have one database that includes images, so I may not be the best person to answer.
I created an images sub-directory alongside the database and driver sub-directories in my Split database. That way if I need to zip the database for a backup or to move it to another machine the images are included in the archive.
For the pro's and con's of storing images in the database see the following discussion
[Tutorial] Pictures in Base

Re: [Solved] Database stored images in Oracle reports

PostPosted: Mon Apr 02, 2018 4:46 pm
by lewisbarry92
Once again, UnklDonald418, your help has been invaluable!! Thank you!!
And thanks to everyone who joined in the discussion here, your input was very much appreciated!

Barry