[Solved]Freestanding form questions

Getting your data onto paper - or the web - Discussing the reports features of Base
Post Reply
gkick
Posts: 324
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile

[Solved]Freestanding form questions

Post by gkick »

Hi ll,

How does one open a report based on a parameter query from a freestanding form?

And how does one run some sql statement from a freestanding form since base macros are not understood by writer

Thks
Last edited by gkick on Fri Feb 14, 2020 3:25 am, edited 1 time in total.
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend
User avatar
Villeroy
Volunteer
Posts: 31324
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: freestanding form questions

Post by Villeroy »

There are no Base macros. The API is exactly the same throughout all components.
MRI tells us how to open a report from within a database document:
SomeDatabaseDocument.ReportDocuments.getByName("MyReport").open()

Of course, ThisComponent does not refer to a database document if the code is embedded in a Writer document. You have to open the Base document with SomeDatabaseDocument=StarDesktop.loadComponentFromURL(...) or get the document containing the report from the registered data sources.
Last edited by Villeroy on Sat Dec 28, 2019 7:38 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
gkick
Posts: 324
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile

Re: freestanding form questions

Post by gkick »

Thks, but I dont get it so the SomeDatabaseDocument.Rep... is the name of the db ? and the url will be the reportname ?
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend
User avatar
Villeroy
Volunteer
Posts: 31324
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: freestanding form questions

Post by Villeroy »

Too complex. Try [Writer] Stand-Alone Database Reports. As long as the row count remains in the hundreds, this could be an alternative solution. Most of my own reports are Calc documents with preformatted import ranges and/or pivot tables.
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
gkick
Posts: 324
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile

Re: freestanding form questions

Post by gkick »

Thanks for that, will test, yet I think not a real alternative for some complex reports featuring rollups, subtotals, totals, averages etc..., so the old switchboard extension does not work (or I can not get it to work) and somehow I have to find a way to hide the database container.
Another weird thing (possibly memory related or gpu - calling a report from a form and the report prompting for parameters, then the parameter dialog pops in front, the calling form hides behind the dbcontainer. Once I close the report I stare at the container and then click the white rectangle in the taskbar to bring the form back up.
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend
Post Reply