[oS-en] I'm finally getting things done with LibreOffice Base
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 After several years, I'm finally progressing with LibreOffice Base. I have a catalogue of my books in MySQL, done with the application Rekall (KDE3). The app is not maintained, so I have been trying for years to migrate to something else, the obvious one LibreOffice Base. It is more difficult that Microsoft Base, which I learned to use without documentation in a month back in 1998. It appears that the trick is that to write to my table I have to use a form, not a table. See what I have (created by the wizard, then modified): <https://susepaste.org/56891822> Top is the table as is, and in the subform below are the controls. See the first row, with a "0_test" book selected. The same book is displayed below. The data Autor, SegundoAutor and TercerAutor display the numbers 1, 2, 3, corresponding to an auxiliary table of authors. The entries below in white background show the text, the names of the first author, second and third, selectable from the list. This has been the hurdle for years (true, I have not dedicated intense study to it). (In Rekall, or in Office, I get the name of the authors directly in the main table. It knows how to handle the relationship automatically, r/w. It was trivial). The simple detail that remains now is to join the label "Autor 1" to the control below, so that when I click there in design view both move as a single object. I have not seen this in the tutorial: Getting Started Guide 7.3 Chapter 8, Getting Started with Base Relational databases in LibreOffice <https://wiki.documentfoundation.org/images/9/99/GS7308-GettingStartedWithBase.pdf> This has been done automatically somehow by the wizard in all the controls it has created. But I do not know how to replicate, and it should be trivial. Somebody knows? - -- Cheers Carlos E. R. (from 15.3 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCY1Wh+Rwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfV4wkAmwf+UHoVx8oCqJVs5mPa VOrEXyzwAJ9KelawLONAPhjSYzf3qOEV0P4Eiw== =C+Op -----END PGP SIGNATURE-----
On 10/23/22 15:20, Carlos E. R. wrote:
This has been done automatically somehow by the wizard in all the controls it has created. But I do not know how to replicate, and it should be trivial.
Somebody knows?
Wish I could help. I always just ended up writing in php and using a html/js/ajax solution (ever since mysql workbench changed). I always found connectors more frustrating to learn than just learning mysql or php, etc.. (though those were not without their frustrations) Many like yours -- poor documentation (except for the MySQL docs -- can't really complain there) But, bad news, your on-line book-seller dream has already been taken. This little company named after a South American river (biggest by volume in the world) stole your idea! But seriously, I see Autor 1 (Isaac Asimov), but what I don't understand is what control you are referring to, or how Autor 1 should move as a single object? Autor_1 (or similar) is a field in one of your MySQL tables that you display at that location on the form. What is it that you consider the single object? (the form-field with it's attribute that links the Autor_1 table-field with it?) -- David C. Rankin, J.D.,P.E.
On 2022-10-24 08:07, David C. Rankin wrote:
On 10/23/22 15:20, Carlos E. R. wrote:
This has been done automatically somehow by the wizard in all the controls it has created. But I do not know how to replicate, and it should be trivial.
Somebody knows?
Wish I could help. I always just ended up writing in php and using a html/js/ajax solution (ever since mysql workbench changed). I always found connectors more frustrating to learn than just learning mysql or php, etc.. (though those were not without their frustrations) Many like yours -- poor documentation (except for the MySQL docs -- can't really complain there)
Now LibreOffice talks to MySQL "natively", doesn't need a connector, but they are also there if you want.
But, bad news, your on-line book-seller dream has already been taken. This little company named after a South American river (biggest by volume in the world) stole your idea!
But seriously, I see Autor 1 (Isaac Asimov), but what I don't understand is what control you are referring to, or how Autor 1 should move as a single object?
Autor_1 (or similar) is a field in one of your MySQL tables that you display at that location on the form. What is it that you consider the single object? (the form-field with it's attribute that links the Autor_1 table-field with it?)
Autor 1 <------ label +---------------+ | | <-- text box containing the autor | | +---------------+ Both label and box should be one joined or group entity. When I click on one in the designer, both should select as one and move as one, as it happens with the boxes/labels created by the wizard. Like the label "Autor" and its box below it. All the grey boxes were created by the wizard, and the whites ones by me. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
On 10/24/22 04:00, Carlos E. R. wrote:
Autor 1 <------ label +---------------+ | | <-- text box containing the autor | | +---------------+
Both label and box should be one joined or group entity. When I click on one in the designer, both should select as one and move as one, as it happens with the boxes/labels created by the wizard. Like the label "Autor" and its box below it.
If LO does it right in an object-oriented manner, then there should be an option to "group" and "ungroup" the text-box and label. Much like you can do in inkscape, or AutoCAD or a myriad of other similar programs. -- David C. Rankin, J.D.,P.E.
On 2022-10-25 09:51, David C. Rankin wrote:
On 10/24/22 04:00, Carlos E. R. wrote:
Autor 1 <------ label +---------------+ | | <-- text box containing the autor | | +---------------+
Both label and box should be one joined or group entity. When I click on one in the designer, both should select as one and move as one, as it happens with the boxes/labels created by the wizard. Like the label "Autor" and its box below it.
If LO does it right in an object-oriented manner, then there should be an option to "group" and "ungroup" the text-box and label. Much like you can do in inkscape, or AutoCAD or a myriad of other similar programs.
It is in menu "format", entry "group", while both entities are highlighted. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
Carlos E. R. wrote:
Autor 1 <------ label +---------------+ | | <-- text box containing the autor | | +---------------+
Both label and box should be one joined or group entity. When I click on one in the designer, both should select as one and move as one, as it happens with the boxes/labels created by the wizard. Like the label "Autor" and its box below it.
All the grey boxes were created by the wizard, and the whites ones by me.
They are clearly different - ignoring the colour, yours also have the label indented by what looks like one character. Disclaimer - I know _nothing_ about LO Base. The way you've described it, it sounds like you created the label and the box separately? Maybe you need to create the box with the label as an attribute. Much like you attach a caption to a box in LO Writer. -- Per Jessen, Zürich (15.4°C)
On 2022-10-25 10:30, Per Jessen wrote:
Carlos E. R. wrote:
Autor 1 <------ label +---------------+ | | <-- text box containing the autor | | +---------------+
Both label and box should be one joined or group entity. When I click on one in the designer, both should select as one and move as one, as it happens with the boxes/labels created by the wizard. Like the label "Autor" and its box below it.
All the grey boxes were created by the wizard, and the whites ones by me.
They are clearly different - ignoring the colour, yours also have the label indented by what looks like one character.
The labels are not part of the box. There is one object, the box (rather a drop list box), and there is an independent text that happens to be very near to the box. I have positioned them with the mouse, which is very hard to do all of them the same way, and worse when having to reposition everything many times. They have to be grouped afterwards - I found that out how this morning, from a hint on usenet. https://help.libreoffice.org/6.1/en-US/text/sdraw/guide/groups.html Only that it is not there, it is in menu "format", entry "group". It should be in the context menu when both entities are selected. Also, the "Label field" is not set automatically with grouping, has to be done manually; apparently this is important for later setting the tab order. My current version of the form is much better, I can already work with it and add book entries to the database.
Disclaimer - I know _nothing_ about LO Base.
The way you've described it, it sounds like you created the label and the box separately? Maybe you need to create the box with the label as an attribute. Much like you attach a caption to a box in LO Writer.
Obviously, that should be the way, but it doesn't exist. I also find out that the "View" of a table has no wizard. I have not yet been able of creating a working "view". -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
Carlos E. R. wrote:
On 2022-10-25 10:30, Per Jessen wrote:
Carlos E. R. wrote:
Autor 1 <------ label +---------------+ | | <-- text box containing the autor | | +---------------+
Both label and box should be one joined or group entity. When I click on one in the designer, both should select as one and move as one, as it happens with the boxes/labels created by the wizard. Like the label "Autor" and its box below it.
All the grey boxes were created by the wizard, and the whites ones by me.
They are clearly different - ignoring the colour, yours also have the label indented by what looks like one character.
The labels are not part of the box. There is one object, the box (rather a drop list box), and there is an independent text that happens to be very near to the box. I have positioned them with the mouse, which is very hard to do all of them the same way, and worse when having to reposition everything many times.
In LO Draw, positioning can also be done with the cursor keys ?
They have to be grouped afterwards - I found that out how this morning, from a hint on usenet.
https://help.libreoffice.org/6.1/en-US/text/sdraw/guide/groups.html
Only that it is not there, it is in menu "format", entry "group".
It should be in the context menu when both entities are selected.
Right - I see it in LO Draw, for instance. 2nd last entry in the context menu. -- Per Jessen, Zürich (16.5°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland.
On 2022-10-25 12:00, Per Jessen wrote:
Carlos E. R. wrote:
On 2022-10-25 10:30, Per Jessen wrote:
Carlos E. R. wrote:
They are clearly different - ignoring the colour, yours also have the label indented by what looks like one character.
The labels are not part of the box. There is one object, the box (rather a drop list box), and there is an independent text that happens to be very near to the box. I have positioned them with the mouse, which is very hard to do all of them the same way, and worse when having to reposition everything many times.
In LO Draw, positioning can also be done with the cursor keys ?
Yes... But with the mouse I get guide lines. Still, as I didn't know how to join them to the boxes, I was not caring about alignment of the labels, I might have to do it many times. Now I can do it. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
Am 23.10.22 um 22:20 schrieb Carlos E. R.:
After several years, I'm finally progressing with LibreOffice Base.
I have a catalogue of my books in MySQL, done with the application Rekall (KDE3). The app is not maintained, so I have been trying for years to migrate to something else, the obvious one LibreOffice Base.
It is more difficult that Microsoft Base, which I learned to use without documentation in a month back in 1998.
It appears that the trick is that to write to my table I have to use a form, not a table. See what I have (created by the wizard, then modified):
<https://susepaste.org/56891822>
Top is the table as is, and in the subform below are the controls.
See the first row, with a "0_test" book selected. The same book is displayed below. The data Autor, SegundoAutor and TercerAutor display the numbers 1, 2, 3, corresponding to an auxiliary table of authors. The entries below in white background show the text, the names of the first author, second and third, selectable from the list. This has been the hurdle for years (true, I have not dedicated intense study to it).
(In Rekall, or in Office, I get the name of the authors directly in the main table. It knows how to handle the relationship automatically, r/w. It was trivial).
The simple detail that remains now is to join the label "Autor 1" to the control below, so that when I click there in design view both move as a single object. I have not seen this in the tutorial:
Getting Started Guide 7.3 Chapter 8, Getting Started with Base Relational databases in LibreOffice
<https://wiki.documentfoundation.org/images/9/99/GS7308-GettingStartedWithBase.pdf>
This has been done automatically somehow by the wizard in all the controls it has created. But I do not know how to replicate, and it should be trivial.
Somebody knows?
Hm. I have the impression that you make your life a bit complicated. As an "old linux crack" you for sure have apache and php installed. So why don't you just use phpMyAdmin? You can use it for everything, it can't be easier. Create, alter databases/tables, inline edit of records, enter, copy, delete records, search... what ever you want. If you really need it then in OpenOffice you can always export it with a click to CSV, the complete table or a selection... -- Daniel Bauer photographer Basel Málaga https://www.patreon.com/danielbauer https://www.daniel-bauer.com -- Daniel Bauer photographer Basel Málaga https://www.patreon.com/danielbauer https://www.daniel-bauer.com
On 2022-10-24 11:05, Daniel Bauer wrote:
Am 23.10.22 um 22:20 schrieb Carlos E. R.:
...
The simple detail that remains now is to join the label "Autor 1" to the control below, so that when I click there in design view both move as a single object. I have not seen this in the tutorial:
Getting Started Guide 7.3 Chapter 8, Getting Started with Base Relational databases in LibreOffice
<https://wiki.documentfoundation.org/images/9/99/GS7308-GettingStartedWithBase.pdf>
This has been done automatically somehow by the wizard in all the controls it has created. But I do not know how to replicate, and it should be trivial.
Somebody knows?
Hm. I have the impression that you make your life a bit complicated. As an "old linux crack" you for sure have apache and php installed. So why don't you just use phpMyAdmin? You can use it for everything, it can't be easier. Create, alter databases/tables, inline edit of records, enter, copy, delete records, search... what ever you want.
I have tried many times over the years. No, impossible.
If you really need it then in OpenOffice you can always export it with a click to CSV, the complete table or a selection...
I already have it fully working in Libre Office, I only need some cosmetic details. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
On Sun, 23 Oct 2022 22:20:09 +0200 (CEST), "Carlos E. R." <robin.listas@telefonica.net> wrote:
After several years, I'm finally progressing with LibreOffice Base.
I have a catalogue of my books in MySQL, done with the application Rekall (KDE3). The app is not maintained, so I have been trying for years to migrate to something else, the obvious one LibreOffice Base.
It is more difficult that Microsoft Base, which I learned to use without documentation in a month back in 1998.
It appears that the trick is that to write to my table I have to use a form, not a table. See what I have (created by the wizard, then modified):
<https://susepaste.org/56891822>
Top is the table as is, and in the subform below are the controls.
See the first row, with a "0_test" book selected. The same book is displayed below. The data Autor, SegundoAutor and TercerAutor display the numbers 1, 2, 3, corresponding to an auxiliary table of authors. The entries below in white background show the text, the names of the first author, second and third, selectable from the list. This has been the hurdle for years (true, I have not dedicated intense study to it).
(In Rekall, or in Office, I get the name of the authors directly in the main table. It knows how to handle the relationship automatically, r/w. It was trivial).
Is it really not possible to have the data from the auxiliary table, instead of the index value, shown in the main table view? That is a poor human interface for L.O. Base. Indexes are just visual garbage.
The simple detail that remains now is to join the label "Autor 1" to the control below, so that when I click there in design view both move as a single object.
So the box on the left containing "Isaac Asimov", with "Autor 1" above it, is a list box control, and you want "Autor 1" to move together with the box when you move it. Open the properties dialog (General tab) for the list box and set 'Label Field' to "Autor 1". Or, if that doesn't work, set 'Name'. [3]
I have not seen this in the tutorial:
Getting Started Guide 7.3 Chapter 8, Getting Started with Base Relational databases in LibreOffice
<https://wiki.documentfoundation.org/images/9/99/GS7308-GettingStartedWithBase.pdf>
This has been done automatically somehow by the wizard in all the controls it has created. But I do not know how to replicate, and it should be trivial.
Somebody knows?
Not me. I'm just guessing. [3] Base Guide 7.3, Chapter 4, Forms, section 'Default settings for many controls', p176,177 https://documentation.libreoffice.org/en/english-documentation/ , 'Download PDF' link for 'Base Guide' (choice of languages at top of the page) -- Robert Webb
On 2022-10-24 12:24, Robert Webb wrote:
On Sun, 23 Oct 2022 22:20:09 +0200 (CEST), "Carlos E. R." <robin.listas@telefonica.net> wrote:
After several years, I'm finally progressing with LibreOffice Base.
I have a catalogue of my books in MySQL, done with the application Rekall (KDE3). The app is not maintained, so I have been trying for years to migrate to something else, the obvious one LibreOffice Base.
It is more difficult that Microsoft Base, which I learned to use without documentation in a month back in 1998.
It appears that the trick is that to write to my table I have to use a form, not a table. See what I have (created by the wizard, then modified):
<https://susepaste.org/56891822>
Top is the table as is, and in the subform below are the controls.
See the first row, with a "0_test" book selected. The same book is displayed below. The data Autor, SegundoAutor and TercerAutor display the numbers 1, 2, 3, corresponding to an auxiliary table of authors. The entries below in white background show the text, the names of the first author, second and third, selectable from the list. This has been the hurdle for years (true, I have not dedicated intense study to it).
(In Rekall, or in Office, I get the name of the authors directly in the main table. It knows how to handle the relationship automatically, r/w. It was trivial).
Is it really not possible to have the data from the auxiliary table, instead of the index value, shown in the main table view? That is a poor human interface for L.O. Base. Indexes are just visual garbage.
I just don't know how. It is trivial in Rekall, but it is abandonware, and it was trivial in M$ base. In LO I know how to display them, creating a "View" (read only). But I have not yet created the view, and the form is using the table. Perhaps I can create the view and tell the form to use the view for that part of the form. Unless I can't manage that and I have to create a new form, a prospect I hate.
The simple detail that remains now is to join the label "Autor 1" to the control below, so that when I click there in design view both move as a single object.
So the box on the left containing "Isaac Asimov", with "Autor 1" above it, is a list box control, and you want "Autor 1" to move together with the box when you move it. Open the properties dialog (General tab) for the list box and set 'Label Field' to "Autor 1".
I did. I just tried a minute before reading your post, and it has no effect.
Or, if that doesn't work, set 'Name'. [3]
It already has a name, which does not display.
I have not seen this in the tutorial:
Getting Started Guide 7.3 Chapter 8, Getting Started with Base Relational databases in LibreOffice
<https://wiki.documentfoundation.org/images/9/99/GS7308-GettingStartedWithBase.pdf>
This has been done automatically somehow by the wizard in all the controls it has created. But I do not know how to replicate, and it should be trivial.
Somebody knows?
Not me. I'm just guessing.
Ah, so you had the same guess as me, a minute ago :-)
[3] Base Guide 7.3, Chapter 4, Forms, section 'Default settings for many controls', p176,177 https://documentation.libreoffice.org/en/english-documentation/ , 'Download PDF' link for 'Base Guide' (choice of languages at top of the page)
Ah, I see. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
On Monday, October 24, 2022, 03:51:09 AM PDT, Carlos E. R. <robin.listas@telefonica.net> wrote:
On 2022-10-24 12:24, Robert Webb wrote:
So the box on the left containing "Isaac Asimov", with "Autor 1" above it, is a list box control, and you want "Autor 1" to move together with the box when you move it. Open the properties dialog (General tab) for the list box and set 'Label Field' to "Autor 1".
I did. I just tried a minute before reading your post, and it has no effect.
Is there a way to export the database configuration in text form, like XML? Maybe you can see what the Wizard did from that. -- Robert Webb
On 2022-10-24 13:24, Robert Webb wrote:
On Monday, October 24, 2022, 03:51:09 AM PDT, Carlos E. R. <robin.listas@telefonica.net> wrote:
On 2022-10-24 12:24, Robert Webb wrote:
So the box on the left containing "Isaac Asimov", with "Autor 1" above it, is a list box control, and you want "Autor 1" to move together with the box when you move it. Open the properties dialog (General tab) for the list box and set 'Label Field' to "Autor 1".
I did. I just tried a minute before reading your post, and it has no effect.
Is there a way to export the database configuration in text form, like XML? Maybe you can see what the Wizard did from that.
The database is external, in MySQL. It can be exported, but only the data is there, AFAIK. The LibreOffice forms are in a separate file, LO own. I can see that what you described is indeed done in the boxes done by the wizard. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
On Sun, 23 Oct 2022 22:20:09 +0200 (CEST) "Carlos E. R." <robin.listas@telefonica.net> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
After several years, I'm finally progressing with LibreOffice Base.
I have a catalogue of my books in MySQL, done with the application Rekall (KDE3). The app is not maintained, so I have been trying for years to migrate to something else, the obvious one LibreOffice Base.
It is more difficult that Microsoft Base, which I learned to use without documentation in a month back in 1998.
It appears that the trick is that to write to my table I have to use a form, not a table. See what I have (created by the wizard, then modified):
<https://susepaste.org/56891822>
Top is the table as is, and in the subform below are the controls.
See the first row, with a "0_test" book selected. The same book is displayed below. The data Autor, SegundoAutor and TercerAutor display the numbers 1, 2, 3, corresponding to an auxiliary table of authors. The entries below in white background show the text, the names of the first author, second and third, selectable from the list. This has been the hurdle for years (true, I have not dedicated intense study to it).
(In Rekall, or in Office, I get the name of the authors directly in the main table. It knows how to handle the relationship automatically, r/w. It was trivial).
The simple detail that remains now is to join the label "Autor 1" to the control below, so that when I click there in design view both move as a single object. I have not seen this in the tutorial:
Getting Started Guide 7.3 Chapter 8, Getting Started with Base Relational databases in LibreOffice
<https://wiki.documentfoundation.org/images/9/99/GS7308-GettingStartedWithBase.pdf>
This has been done automatically somehow by the wizard in all the controls it has created. But I do not know how to replicate, and it should be trivial.
Somebody knows?
Undoubtedly one of the experts on the libreoffice mailing list users@global.libreoffice.org will be able to answer. See https://www.libreoffice.org/get-help/mailing-lists for details, or if you prefer Spanish then look at https://wiki.documentfoundation.org/Local_Mailing_Lists#Spanish (obviously I don't know what level of expertise is on the Spanish lists)
On 2022-10-23 22:20, Carlos E. R. wrote:
After several years, I'm finally progressing with LibreOffice Base.
I have a catalogue of my books in MySQL, done with the application Rekall (KDE3). The app is not maintained, so I have been trying for years to migrate to something else, the obvious one LibreOffice Base.
It is more difficult that Microsoft Base, which I learned to use without documentation in a month back in 1998.
It appears that the trick is that to write to my table I have to use a form, not a table. See what I have (created by the wizard, then modified):
<https://susepaste.org/56891822>
Top is the table as is, and in the subform below are the controls.
See the first row, with a "0_test" book selected. The same book is displayed below. The data Autor, SegundoAutor and TercerAutor display the numbers 1, 2, 3, corresponding to an auxiliary table of authors. The entries below in white background show the text, the names of the first author, second and third, selectable from the list. This has been the hurdle for years (true, I have not dedicated intense study to it).
(In Rekall, or in Office, I get the name of the authors directly in the main table. It knows how to handle the relationship automatically, r/w. It was trivial).
And finally, I have a working form that I'm happy with: https://susepaste.org/64405591 It has been created with the Form Wizard, then modified. I don't care much about visual perfection. Positioning everything perfectly takes a lot of time, and as this is just for my personal use, I don't need more. I can modify it in years to come, anyway :-D The top part that seems a read only excel table takes the data from a query, done with "Create query in design view". It does the same thing as "Create view", except that it saves to the LO file instead of to the mysql table (that's the difference to my untrained eye). A view, once saved, is impossible to get the design view again. Working from a query is necessary so that numeric entries such as "Author" are converted to their name. This is done graphically in the design editor, no need to play with SQL code. The bottom part is a "subform", created by the wizard, and pulls from the Table (books) itself. It is read write. The wizard creates numeric boxes for Author and such (the boxes are still visible at the bottom). Instead I created drop lists that pull from their respective small mysql tables. I may still create forms for creating new authors, genres, etc, or not. They are simple tables, can be managed directly on their tables. The database was created, well over a decade ago, using "Rekall". It is abandonware. I'm using an old version (2018) that still runs in Leap 15.3 (by locking the packages). It is a KDE 3 application. It used a trick: it adds a __RekallObjects table to the database, to store some things it needs. Hidden relationships, I guess. Pity it was abandoned, it works very well. I used it the other day to change the size of a VARCHAR field. LO warns (in the docs) that this is not possible on an existing database, but Rekall does it fine. I also added a new field. Something I may still need is exporting the whole books table to a flat calc sheet, that I can then read in my mobile phone when going shopping for books. I did it once from Rekall to Google Calc, with LO Calc as intermediate. But that is a different problem. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
On Sun, 30 Oct 2022 12:54:53 +0100, "Carlos E. R." <robin.listas@telefonica.net> wrote:
And finally, I have a working form that I'm happy with: https://susepaste.org/64405591
Excellent. This thread you have been posting has served as a useful tutorial for me.
Something I may still need is exporting the whole books table to a flat calc sheet, that I can then read in my mobile phone when going shopping for books. I did it once from Rekall to Google Calc, with LO Calc as intermediate. But that is a different problem.
I recall reading that exporting to a calc sheet is the first step needed to export a database table to a CSV (comma separated values) file, and that only the field contents, with no meta-information, of a table is exported. I assume that means that your Autor fields that reference other tables will just contain the index numbers, which is not what you want. So, maybe you can export the view (query) that you posted above instead of the table itself, and thereby export the actual info you are interested in. If so, let us know. -- Robert Webb
On 2022-10-31 02:26, Robert Webb wrote:
On Sun, 30 Oct 2022 12:54:53 +0100, "Carlos E. R." <robin.listas@telefonica.net> wrote:
And finally, I have a working form that I'm happy with: https://susepaste.org/64405591
Excellent. This thread you have been posting has served as a useful tutorial for me.
:-)
Something I may still need is exporting the whole books table to a flat calc sheet, that I can then read in my mobile phone when going shopping for books. I did it once from Rekall to Google Calc, with LO Calc as intermediate. But that is a different problem.
I recall reading that exporting to a calc sheet is the first step needed to export a database table to a CSV (comma separated values) file, and that only the field contents, with no meta-information, of a table is exported. I assume that means that your Autor fields that reference other tables will just contain the index numbers, which is not what you want. So, maybe you can export the view (query) that you posted above instead of the table itself, and thereby export the actual info you are interested in. If so, let us know.
Yes, that's exactly the thing. If the exporting is done from Rekall, it is not a problem because "somehow" when opening the table it knows how to display the text instead of the numeric index of author, genre, etc. It knows, even though there are no relationships defined in the sql. This was the hurdle I had for many years when using LO: it displayed the numbers and I did not know why. Rekall I think had this information in a special table inside the database. So yes, for exporting I will try using the table view or the query. Dunno which. Preferably the query. I see already that in the query I can not select all the fields for copy-paste somewhere else. Same thing in table Data View. I have to do more reading, because surely somebody else will have done the same before. Maye using a report, or perhaps creating a Calc Sheet that imports database data, which I read it is possible. IF it display author names, not IDs. Dunno. That part is nor urgent, though. At worst, I can access my database from my laptop, remotely, via an ssh tunnel to mysql :-DDD I hit tonight a new problem, though: in the form I have I can not create a new book entry. In the top half of the form, the table like view, new record button doesn't respond, because it takes data from a Query and thus, it is read only. In the bottom half of the form it does create a new record, yes, but the Index field displays "<AutoField>" and not a newly created index number. When trying to save the record, it says the number is a duplicate. I can not write a number by hand, either. I'm stuck there and have to close the form completely, without saving, to recover: Error inserting the new record /home/abuild/rpmbuild/BUILD/libreoffice-7.3.6.2/connectivity/source/commontools/dbtools.cxx:747 Duplicate entry '374' for key 'PRIMARY' /home/abuild/rpmbuild/BUILD/libreoffice-7.3.6.2/connectivity/source/drivers/mysqlc/mysqlc_general.cxx:119 So I have to create a new record somewhere else, then edit with my form. I will need to solve this new problem somehow. My previous attempt at form creation works at creation of a new record, because the top half pulls data from the table directly (thus displays ID number instead of author names). The bottom half has, apparently, the same problem as my new form. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
On 2022-10-31 03:17, Carlos E. R. wrote:
On 2022-10-31 02:26, Robert Webb wrote:
...
I hit tonight a new problem, though: in the form I have I can not create a new book entry.
In the top half of the form, the table like view, new record button doesn't respond, because it takes data from a Query and thus, it is read only.
In the bottom half of the form it does create a new record, yes, but the Index field displays "<AutoField>" and not a newly created index number. When trying to save the record, it says the number is a duplicate. I can not write a number by hand, either. I'm stuck there and have to close the form completely, without saving, to recover:
Error inserting the new record /home/abuild/rpmbuild/BUILD/libreoffice-7.3.6.2/connectivity/source/commontools/dbtools.cxx:747
Duplicate entry '374' for key 'PRIMARY' /home/abuild/rpmbuild/BUILD/libreoffice-7.3.6.2/connectivity/source/drivers/mysqlc/mysqlc_general.cxx:119
The issue is that as the top half query and bottom part are linked by the index number, it means that the bottom part can only display one entry, that whose index is highlighted in the top part. Attempting to create a new record is limited to that number, so creating a new index number doesn't work. Longer explanation here: <https://ask.libreoffice.org/t/lo-base-i-created-a-form-to-handle-a-table-but-can-not-create-new-record/83532/3> The way to get out of here is create the new record externally, so the obvious idea is to create a button that calls a form that does just that. Caveat: LO doesn't have a button to do just that (M$ Base does). It has to be done with custom code, or a macro. Fortunately the chap that was helping me knows this, and posted the code and instructions. Initially this failed, but he found out why, and now I have it working, and I just added the books that were still not in the database a few minutes ago. :-D -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
On 11/2/22 16:25, Carlos E. R. wrote:
Fortunately the chap that was helping me knows this, and posted the code and instructions. Initially this failed, but he found out why, and now I have it working, and I just added the books that were still not in the database a few minutes ago.
That's awesome. Still seems like a convoluted way to have to interface with a database, but if you prefer having a utility do it instead of writing the html/php (or whatever interface you want to use), then all is good. I've always been wary of the wiggle-your-ear work-arounds like buttons that do nothing but add an empty record. SQL is pretty straight-forward and any app like LO should be able to handle an INSERT query without a lot of muss and fuss. Bash (or any shell, but particularly bash with the string-handling parameter expansions) is really good at manipulating records in batch-mode 'mysql -b ...'. Depending on your needed to add an occasional record or query your database, simple alias or 2-line scripts work fine too. Glad you got your books added and working in something that will still be supported (unless they radically change it :) -- David C. Rankin, J.D.,P.E.
On 2022-11-04 06:08, David C. Rankin wrote:
On 11/2/22 16:25, Carlos E. R. wrote:
Fortunately the chap that was helping me knows this, and posted the code and instructions. Initially this failed, but he found out why, and now I have it working, and I just added the books that were still not in the database a few minutes ago.
That's awesome. Still seems like a convoluted way to have to interface with a database, but if you prefer having a utility do it instead of writing the html/php (or whatever interface you want to use), then all is good.
I see people complaining about things that are easy to do in M$ Base and not in LO Base, and now I am understanding why, besides those I already knew. And missing documentation about those complicated things. Like code.
I've always been wary of the wiggle-your-ear work-arounds like buttons that do nothing but add an empty record. SQL is pretty straight-forward and any app like LO should be able to handle an INSERT query without a lot of muss and fuss.
But I know noting of SQL, and not about to learn now. Still, you have to trigger when to run that SQL, and that's a button.
Bash (or any shell, but particularly bash with the string-handling parameter expansions) is really good at manipulating records in batch-mode 'mysql -b ...'. Depending on your needed to add an occasional record or query your database, simple alias or 2-line scripts work fine too.
If you know sql.
Glad you got your books added and working in something that will still be supported (unless they radically change it :)
That's the idea :-) -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
participants (7)
-
Carlos E. R.
-
Carlos E.R.
-
Daniel Bauer
-
Dave Howorth
-
David C. Rankin
-
Per Jessen
-
Robert Webb