OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Incorporating Images in forms??? Problem!

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
yasarahmad
Newbie
Newbie


Joined: 25 Mar 2010
Posts: 1

PostPosted: Thu Mar 25, 2010 4:38 am    Post subject: Incorporating Images in forms??? Problem! Reply with quote

Hi Guys,

Firstly I'm new to the site, after going crazy trying to figure this out I've decided to make a post.

I'm designing a database for a company for employees, to insert the employees details I created a form in the wizard. I want to incorporate pictures so that I know what each employee looks like.

When creating the initial database with the wizard I did include a column for Images. So when creating the form I selected Images as an entry but when going into the form there is no option to upload a picture. Im so confused I really dont know much about this and need help urgently!

Please Someone Help Thank You!!!! Smile
Back to top
View user's profile Send private message
RPG
Super User
Super User


Joined: 24 Apr 2008
Posts: 2697
Location: Apeldoorn, Netherland

PostPosted: Thu Mar 25, 2010 11:16 am    Post subject: Reply with quote

Hello

Make an image control.
let the data field point to an file in a map where you database is
Don't store your image in your database.
http://www.oooforum.org/forum/viewtopic.phtml?t=73329

Romke
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Thu Mar 25, 2010 11:19 am    Post subject: Reply with quote

RPG wrote:
Hello

Make an image control.
let the data field point to an file in a map where you database is
Don't store your image in your database.
http://www.oooforum.org/forum/viewtopic.phtml?t=73329

Romke

The macro in that thread is obsolete. Meanwhile we can bind a picture control to a text field of relative file URLs.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
RPG
Super User
Super User


Joined: 24 Apr 2008
Posts: 2697
Location: Apeldoorn, Netherland

PostPosted: Thu Mar 25, 2010 11:29 am    Post subject: Reply with quote

Hello

In that thread there are several things some are old but in the beginning I have placed an advice for people who used newe version of OOo3.0 have to go to the end of that thread. So people have not to use more that macro. That is explained there careful. I suppose people can read

Romke
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Thu Mar 25, 2010 11:48 am    Post subject: Reply with quote

Ah, I see. Thank you.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
RPG
Super User
Super User


Joined: 24 Apr 2008
Posts: 2697
Location: Apeldoorn, Netherland

PostPosted: Sat Mar 27, 2010 3:24 am    Post subject: Reply with quote

For me for unclear reason this post was double.
So I delete the text as much as possible.


Last edited by RPG on Sat Mar 27, 2010 7:43 am; edited 1 time in total
Back to top
View user's profile Send private message
RPG
Super User
Super User


Joined: 24 Apr 2008
Posts: 2697
Location: Apeldoorn, Netherland

PostPosted: Sat Mar 27, 2010 3:34 am    Post subject: Reply with quote

Hello

For Villeroy maybe it is better to make a summary of all the old information so I start here for new information. I did think about it earlier but I was not clear about the problems.

I Think the most important information in the link where I did point is now in this post.


preferred methode
You can bind an image control to an text field or a longvarbinary. The preferred method with the HSQLDB database is a textfield.


How to handle an image control in a form
In short
Make an image control in your form.
Bind this to a text field.
fill that text field with an url.
or
Click on the image control for selecting the image

How to insert the image
When you double click on the image control then you get the possibillity to select an image. When you have a text field for the image then the url is stored in the database. When you have a longvarbinary for the control then the image is stored in the database.


That is all
I think all you need to know is explained above. But not all people knew what is an url and more things. I will try to explain that in more detail

Multi user
In case your database is a multiuser then it can be better to insert complete urls but maybe the next is possible. Collect all the images in one map and lower. Give every user a link to this map on the same place as where the database document is. I have no experience with this idea.



Database document
I mean with this the file database.odb

URL
This is the defination in OOo.
The Uniform Resource Locator (URL) displays the address of a document or a server in the Internet. The general structure of a URL varies according to type and is generally in the form Service://Hostname:Port/Path/Page#Mark although not all elements are always required. An URL can be a FTP address, a WWW (HTTP) address, a file address or an e-mail address.

If you have a complete url then it point precise to one file on a computer or internet. If it is not complete it assumes most of the time a file on your computer.

Relative
The url which the image control use is standard relative to the same path as where the database doucment is.

Difference between relative and complete url
If you use complete url then you can replace the database document on your computer whithout problems and maybe even uee it on an other computer in the same network. If the url is relative then when you replace the database document then you have also to replace the image. On this moment I have no idea what is the best place but I think all image in one map below the place where your database document is.



Understanding how url works with image control
I can understand it is difficult to understand how urls are working with the image control. This wil try to explain it to you with an step by step example.

This is only a little lesson, you can skip it.
I do assume you can make a picture box.
1) make an empty form in edit mode
2) make an image control in the form.
3) Right click on the image control
4) select in the popup the word control and click on the word
5) Select now the General tabpage
6) go to graphics five from below
7) click on the little square right.be a little patient
8 ) Now you can select a picture from your hard disk to this control.
9) If you select the picture by name click on OK
10 If all things are going good now you see the picture in the control.
11 in the tabpage you see the url.
12 The form is still in edit mode.
13 change the off edit mode.
14 click on the picture.

Now you can understand what the URLs are doing.


Image in table.
When you want have the image in your table and not the urls then when you have to organize your form well then it can be work good.
Use a mainform for selecting an image
Don't use a lot of picture in one subform at the same time
Use small image and not big.
Remember OOo is an office program and not for images

For detailed information see both links below

http://www.oooforum.org/forum/viewtopic.phtml?t=73329&postdays=0&postorder=asc&start=0
http://www.oooforum.org/forum/viewtopic.phtml?t=81069&highlight=

I hope this is clear to people who have little experience with OOo-base.

Romke
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Sat Mar 27, 2010 4:30 am    Post subject: Reply with quote

The most simple implementation for images through file names (URL):
Keep the database and the pictures in the same directory.
Avoid all spaces and special chars in file names. Restirct file names to ASCII letters a-z, digits and underscore.
Enter/paste/import the file names into some text field.
Draw a picture control into a form and bind it to the field of file names.
Just the plain file names from the same directory without special chars pull the picture data into the control

Under linux the shell command
ls -1 *.{png,jpg} > pics.txt
dumps all file names with suffix .png or jpg into file pics.txt as a single column list:
Apple.png
Mother.png
Juice.jpg
...
Also under Linux links do actually work. The file name may point to some file elsewhere.

In HSQLDB this text file can be linked as text table (CREATE TEXT TABLE...)
You can also use the copy&paste facility in Base.
Both import methods leave you alone with a single column of text. But you may link this text through a combo box to fill out another table's text column. Then your form would contain a combo box and a picture control bound to the same text field.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group