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
[Solved]Freestanding form questions
[Solved]Freestanding form questions
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
Re: freestanding form questions
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.
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: freestanding form questions
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
Re: freestanding form questions
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
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: freestanding form questions
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.
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