Hyperlink datatype

Discuss the database features
Post Reply
davidspade
Posts: 5
Joined: Thu Jan 25, 2018 6:37 pm

Hyperlink datatype

Post by davidspade »

Can we have a column datatype of "hyperlink" please?
Makes a database of restaurants really slick! :D
Open Office 4 on Sierra
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: hyperlink datatype

Post by Villeroy »

 Edit: See my posting of 2018-02-06 for a simpler macro solution. 
Last edited by Villeroy on Tue Feb 06, 2018 10:20 pm, edited 1 time in total.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
davidspade
Posts: 5
Joined: Thu Jan 25, 2018 6:37 pm

Re: Hyperlink datatype

Post by davidspade »

Thank you. What do I need to do to deploy this for my database? ( haven't been a developer since the late 60s when they were called computer programmers!)
Open Office 4 on Sierra
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Hyperlink datatype

Post by Villeroy »

 Edit: See my posting of 2018-02-06 for a simpler macro solution. 
Last edited by Villeroy on Tue Feb 06, 2018 10:12 pm, edited 1 time in total.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
davidspade
Posts: 5
Joined: Thu Jan 25, 2018 6:37 pm

Re: Hyperlink datatype

Post by davidspade »

Hi, I'm struggling here. I've downloaded the code and put it in the new folder, but I guess I now have to maker that visible to my database with its column of Web addresses, and then to presumably execute it when needed. Or is it only executed once? Thank you.
Open Office 4 on Sierra
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Hyperlink datatype

Post by Villeroy »

 Edit: See my posting of 2018-02-06 for a simpler macro solution. 
Last edited by Villeroy on Tue Feb 06, 2018 10:13 pm, edited 1 time in total.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
davidspade
Posts: 5
Joined: Thu Jan 25, 2018 6:37 pm

Re: Hyperlink datatype

Post by davidspade »

I've had little time lately, apologies, but will get to grips with it tomorrow. Meanwhile, I should tell you that my column is WWW addresses only, as I forgot to say before. I hope this simplifies the instructions!
Thank you.
Open Office 4 on Sierra
jjsmith2
Posts: 5
Joined: Tue Feb 06, 2018 2:41 am

Re: Hyperlink datatype

Post by jjsmith2 »

Hi Villeroy,
Thanks for the response but I am not sure what to do. I clicked the link you provided above and ran the Python thing.
Here is one of the web site links I put in the database column =HYPERLINK "http://www.cakemaker.net"www.cakemaker.net
Does the syntax look correct to you?
My database includes a number of similar URL's. I created a table with various columns of data.
I then created a Form that turned out pretty good. I then added the Hyperlink icon to the tool bar.
The problem is that the icon is grayed out and won't connect to the column of URL websites in my table.
Is Open Office Base missing something here or is it me (probably me).
If Python is the only work around then what are my next steps.
Thanks.
Jim
Apache OpenOffice 4.1.5
UnklDonald418
Volunteer
Posts: 1544
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Hyperlink datatype

Post by UnklDonald418 »

A solution using a basic macro can be found at
Re: Join Question on Hyperlink field in table
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Hyperlink datatype

Post by Villeroy »

viewtopic.php?f=100&t=92331&p=438435#p438435 includes a better version of my oder URLButton macros.
Open my database, the "PythonCode" form and push the button on that form to install the macro.
Draw a button onto your own form.
Set action "Open document/web page"
Add the name of the underlying column (no form control needed).
Assign the "Approve Action" event to "My Macros" > pyDBA > ButtonURL > URLButton_Approve
If your column stores system paths, use macro FileButton_Approve instead of URLButton_Approve. This variant includes a conversion from system paths to file-URL.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
davidspade
Posts: 5
Joined: Thu Jan 25, 2018 6:37 pm

Re: Hyperlink datatype

Post by davidspade »

Sorry, all I have is a simple database of pubs and restaurants which includes a column of web addresses, plus a few selective queries.
I was only able to create this because it wasn't too different from Microsoft Access which I have used before, again in a rudimentary way.
There are no forms associated with this.
I think your solutions require a level of familiarity which I haven't got, because I still don't see how to apply them.
Thank you for your help any way, I'm sure the solutions are excellent, but I think I'll just give up at this point!
Regards.
Open Office 4 on Sierra
jjsmith2
Posts: 5
Joined: Tue Feb 06, 2018 2:41 am

Re: Hyperlink datatype

Post by jjsmith2 »

You need to get out of the Table button and click the Forms button then click the wizard to design a form.
Apache OpenOffice 4.1.5
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Hyperlink datatype

Post by Villeroy »

Install the latest verson of my macro. I uploaded a slightly modified version today (even simpler).
Right-click>Edit... your form.
Add a push button from toolbar "Form Controls"-
Double-click the push button for the properties dialog.
Enter the name of the hyperlink column as "additional info" on the first tab "General".
On the "Events" tab click [...] near the "Approve action" event, click [Macro...] and navivate to "My Macros">pyDBA>URLButton>URLButton_Approve
Confirm your macro selection.
Save the form.
Save the database document.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
dreamquartz
Posts: 881
Joined: Mon May 30, 2011 4:02 am

Re: Hyperlink datatype

Post by dreamquartz »

Hi Villeroy,

Tried the latest version from your link in both LO 5.4.4.2 and 6.0.1.1 and the outcome is the same.
Please see attachment.
Screenshot from 2018-02-16 22-25-23-1.png
When returning to your previous version all works fine.

Dream
LO 7.x, HSQLDB 2.7.x & Ubuntu 22.04 LTS.
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Hyperlink datatype

Post by Villeroy »

Thank you very much. I did not anticipate that wrong cursor position could be a problem. since empty URLs didn't raise any error at all.
Next try: download/file.php?id=34141
Open PythonCode form, click buton, open other form, go to new record, click buttons, nothing happens.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
dreamquartz
Posts: 881
Joined: Mon May 30, 2011 4:02 am

Re: Hyperlink datatype

Post by dreamquartz »

Villeroy wrote:Thank you very much. I did not anticipate that wrong cursor position could be a problem. since empty URLs didn't raise any error at all.
Next try: download/file.php?id=34141
Open PythonCode form, click buton, open other form, go to new record, click buttons, nothing happens.
Looking at the code, it appears to be incomplete.
See attached response under LO 6.
Screenshot from 2018-02-17 21-00-57.png
Dream
LO 7.x, HSQLDB 2.7.x & Ubuntu 22.04 LTS.
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Hyperlink datatype

Post by Villeroy »

Your form's "after recod change" event is bound to a macro that does not exist anymore. The old macro changed all URLs of all buttons that followed a naming scheme when the record was changed. Remove the form event and use the button's "approve action" event instead.

The simpler new macro makes use of the fact that the "approve action" event is called before the actual action takes place so you can manipulate the calling button's "URL" and "Action" properies and then perform the setup action with one click on a push button.
Now you can name the button any way you want, note the column name as "additional info" and assign the "approve action" event in order to turn a normal button into an URL-button. Assign the file button variant if conversion from system path to URL is needed.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
dreamquartz
Posts: 881
Joined: Mon May 30, 2011 4:02 am

Re: Hyperlink datatype

Post by dreamquartz »

Missed that one.
I do come across an issue that might appears to be interesting. I am using multiple tables to store information where I want to utilize this nice macro.
Examples ate "tWebSite", "tEmail", "tAddress", "tFaceBook", "tTwitter". With the previous macro there was no problem. I created a Query like qWebSiteShown to process all the WebSites, so that the button could be used. The Query runs at the Subform level fWebSite, and the Action is on the form, and not on the button.

The macro you provided here works great if the information is stored in 1 table, but that is not the case with my DataBase.

I would like to use the same principle you are offering right now, but I stay stuck @ the first record for all the tables.

Any idea what this could be?

Dream
LO 7.x, HSQLDB 2.7.x & Ubuntu 22.04 LTS.
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Hyperlink datatype

Post by Villeroy »

It should simply work with the same buttons on the same forms. Remove the form's "After record change" event and apply the "Approve" event to the same buttons that used to work with the old macro.
Anyhow, you can still use the old one. There is nothing wrong with that. It is still contained in download/file.php?id=27032
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply