How to create the picture link in table and form per ID?

Discuss the database features
Post Reply
Feanna
Posts: 37
Joined: Sun Aug 03, 2008 4:13 pm

How to create the picture link in table and form per ID?

Post by Feanna »

I create the table in my Base, but i don't know how to insert the hyperlink and file link in my table field, i want the function is... when i click the table field or querie, the picture will open with the default program, can you tell me how to do it?

IF cannot add this function in field, i know how to insert the picture to form, the fuction is "Image control", but just only display the picture per ID, when i insert the hyperlink, all ID is link to same picture, how to give the hyperlink or file link into per ID, and open the picture with the default program?

And then, can i made this function in Queries and Reporting?
thanks a lot!
OOo 3.4.1 on Ms Windows 7
User avatar
Steve Z1000
Posts: 13
Joined: Tue Oct 07, 2008 12:30 am
Location: Gandia / SPAIN

Re: How to create the picture link in table and form per ID?

Post by Steve Z1000 »

Hi,

i think we have the same problem (look at my posts) - but even worse - i can`t find the picture control because my system runs in spanish.

does any one know how this command is called in spanish ? I`m almost going crazy !
OOo 3.0.X on MS Windows Vista
Feanna
Posts: 37
Joined: Sun Aug 03, 2008 4:13 pm

Re: How to create the picture link in table and form per ID?

Post by Feanna »

Oh! I Know how to do already, it need add the Macro in Forms, this macro is written by myself,
when i click the Text Box with my mouse button, the photo will open, but you need input
the word in Text Box like this "C:\Documents and Settings\photo.jpg".
PS. txtImage is a Text Box.

Hey Steve z1000,
picture control is need to go to form design toolbar, and then click more control button, you can see more control toolbar will start.

Code: Select all

REM  *****  BASIC  *****

sub OpenFile

dim oFormCtl as object
dim txtImage as object
dim url as string

oFormCtl = ThisComponent.Drawpage.Forms.getByName("MainForm")
txtImage = oFormCtl.getByName("txtImage")

url = txtImage.Text

Shell("C:\WINDOWS\system32\rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen " + url , 1)

end sub
OOo 3.4.1 on Ms Windows 7
User avatar
Steve Z1000
Posts: 13
Joined: Tue Oct 07, 2008 12:30 am
Location: Gandia / SPAIN

Re: How to create the picture link in table and form per ID?

Post by Steve Z1000 »

First of all thanx,

Does this Macro open the pic in a seperate Application or does it show in the Box of the existing Form sheet ?
I need the pic to open in a Picture box in the form sheet.
OOo 3.0.X on MS Windows Vista
User avatar
Steve Z1000
Posts: 13
Joined: Tue Oct 07, 2008 12:30 am
Location: Gandia / SPAIN

Re: How to create the picture link in table and form per ID?

Post by Steve Z1000 »

Ok it works,

But opens Picture in the windows Picture Viewer.

I want to see the picture in the Sheet

How can i do that ?
OOo 3.0.X on MS Windows Vista
User avatar
r4zoli
Volunteer
Posts: 2882
Joined: Mon Nov 19, 2007 8:23 pm
Location: Budapest, Hungary

Re: How to create the picture link in table and form per ID?

Post by r4zoli »

Make a report with SRB, install SRB extension, and you can add picture control to report.

You can add image control to forms: Activate Form Control toolbar by View>Toolbar>Form Controls, click on more controls, and click on Image control and draw rectangle in form area.
AOO 4.0 and LibO 4 on Win 8
Hungarian forum co-admin
User avatar
Steve Z1000
Posts: 13
Joined: Tue Oct 07, 2008 12:30 am
Location: Gandia / SPAIN

Re: How to create the picture link in table and form per ID?

Post by Steve Z1000 »

Thanx for making me download the new version of OO and the Sun Report Builder, now i have the newest version :D

but that doesn`t work because the Report Builder only runs doing Info Forms.
I need the picture in the Data Base Sheet, so i can see additionaly to the Article Number the correspondig Image.
This Image has to change whenever i change the Data Field.

In the Image Control Field i can only introduce the direct link of one Picture. I`m looking for a tool or macro (i don`t know writing Macros)
wich changes the Picture field in the Picture Control Menu each time i change the data set. Something like a Picture gallery linked with the Article Number.

The Macro that was posted earlier works but it opens the picture in the windows viewer app.
That means that everytime y change the data set i opens a new window.
OOo 3.0.X on MS Windows Vista
User avatar
r4zoli
Volunteer
Posts: 2882
Joined: Mon Nov 19, 2007 8:23 pm
Location: Budapest, Hungary

Re: How to create the picture link in table and form per ID?

Post by r4zoli »

I think you mix two different thing, Form and Report.

Form is a writer document with different controls, for inserting data/pictures into tables, and viewing it.

Report is retrieving data/, pictures from database table into writer or calc documents.

Your problem is the first, you want to insert data+picture into database table and scrolling them through a whole database?

Please describe your database, which table and which data it contain.

If you can upload empty odb file, which you have a problem.
AOO 4.0 and LibO 4 on Win 8
Hungarian forum co-admin
User avatar
Steve Z1000
Posts: 13
Joined: Tue Oct 07, 2008 12:30 am
Location: Gandia / SPAIN

Re: How to create the picture link in table and form per ID?

Post by Steve Z1000 »

I have uploaded a Example similar to the data base i have.
The Field Image Link i`d like to see a the picture corresponding to the Article Number Picture.
The picture should change everytime y chnge the Artikle Number or hit the next or previous Button.
The Image Link Field is only formated as Image.

Can be that i get mixed up with the right definitions because my OOBase is in spanish - sorry :D
Attachments
Nueva base de datos3.odb
(10.72 KiB) Downloaded 294 times
OOo 3.0.X on MS Windows Vista
User avatar
r4zoli
Volunteer
Posts: 2882
Joined: Mon Nov 19, 2007 8:23 pm
Location: Budapest, Hungary

Re: How to create the picture link in table and form per ID?

Post by r4zoli »

I hope this link helps you.
AOO 4.0 and LibO 4 on Win 8
Hungarian forum co-admin
Feanna
Posts: 37
Joined: Sun Aug 03, 2008 4:13 pm

Re: How to create the picture link in table and form per ID?

Post by Feanna »

Steve Z1000,
Are u want to when u click the table (Image Link,Row 1), 6700001001.jpg will open, then u click (Image Link,Row 3), 6700001003.jpg will open? If right, i edit you ODB file, it have this function, but not perfect, because i want the mirco tell me , when i click the table (Image Link,Row 1), the result is "Image Link", when i click (URL,Row 3), the result is "URL", but i don't know how to auto get the target name, i need input the name by myself now, so... not perfect, anyone can help me? :D

Well, i add field name and change field type from table
(Image Link : Memo ) , (View Image : Yes/No Boolean)
(URL : Memo ) , (View URL : Yes/No Boolean)
(Email : Memo ) , (Email to : Yes/No Boolean)
i also create form, the name is "Tabla Test2", please edit "Tabla Test2", and double click "MainForm_Grid", table control properties will open, click "View Image" on "MainForm_Grid" , properties window will change to check box, click Events -> Item status changed, add "FormGrid_ViewImage_Click" marco here (please create the marco first), then click "View URL", click Events -> Item status changed, add "FormGrid_ViewURL_Click" marco,then click "Email to", click Events -> Item status changed, add "FormGrid_EmailTo_Click" marco.
My micro follow there.

Code: Select all

REM  *****  BASIC  *****

Sub FormGrid_ViewImage_Click

dim oFormCtl as object 
dim Image as object
dim url as string

oFormCtl = ThisComponent.Drawpage.Forms.getByName("MainForm") 
Image = oFormCtl.getByName("MainForm_Grid").getByName("Image Link")
url = Image.Text

Shell("C:\WINDOWS\system32\rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen " + url , 1)

End Sub


Sub FormGrid_ViewURL_Click

dim oFormCtl as object 
dim WebUrl as object
dim url as string

oFormCtl = ThisComponent.Drawpage.Forms.getByName("MainForm") 
WebUrl = oFormCtl.getByName("MainForm_Grid").getByName("URL")
url = WebUrl.Text

Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE", 1 , url)

End Sub


Sub FormGrid_EmailTo_Click

dim oFormCtl as object 
dim WebUrl as object
dim url as string

oFormCtl = ThisComponent.Drawpage.Forms.getByName("MainForm") 
Email = oFormCtl.getByName("MainForm_Grid").getByName("Email")
url = Email.Text

Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE", 1, url)

End Sub
Attachments
Nueva base de datos3.odb
(20.22 KiB) Downloaded 246 times
OOo 3.4.1 on Ms Windows 7
User avatar
Steve Z1000
Posts: 13
Joined: Tue Oct 07, 2008 12:30 am
Location: Gandia / SPAIN

Re: How to create the picture link in table and form per ID?

Post by Steve Z1000 »

This is great !

Look at the link

http://www.oooforum.org/forum/viewtopic ... 2089eaae60

That`s just what i was looking for, even though i still don`t get it running, it seams these guys have the solution.
I think these guys can help me getting it to run too.

Thanx :D
OOo 3.0.X on MS Windows Vista
Post Reply