Sub OpenMyReport(oEvent As Object)
Dim RptName as string
RptName = "FeeCalculation"
ThisDatabaseDocument.ReportDocuments.getByName(RptName).open
End Sub
this gives an error i,e, the object variable is not set and it points to this code
No, in that thread I redirected someone to use stand-alone form documents without any macros. Unfortunately, this does not apply to reports which is one reason why I prefer spreadsheet reports.
The first message of this topic contains macro code to open a report with the hard coded name "FeeCalculation" stored in the same database document as the macro.
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
That code seems to work as long as you have a report name "FeeCalculation" (case sensitive). And the code is saved to your .odb file (i.e. not MyMacros).
Thank you DAMC that worked i saved the macros into MyMacros and when i shifted it into .odb file and it worked.
i wanted to ask one last thing that i have made a report that requires you to enter the student id is it possible to edit the macros such that it will take the student id value from the form text box
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
You clearly did not study the second example but I have the idea that it is not good for you to work with macros. I think follow the way of Villeroy and try to do it without macros.
As far as I know, it takes a macro to open embedded objects by push button. We get rid of this limitation when we open stand-alone documents by means of ordinary hyperlinks. Any office document can have forms attached.
There are no reports outside the Base document except for Calc sheets with linked import ranges. WIth a little bit of hand made column layout, page styles and cell styles Calc can be fine tuned to serve as additional report generator not as good looking as Writer documents but with a lot of extra functionality.
Loading reports and forms filtered by current form content is possible without macros if the filter criteria are stored in some filtering record. Search this forum for "power filtering" by user Arineckaig.
Filtering record sets by macros requires programming skills even when you copied the methods from existing code. The details depend on the exact data types and how to substitute parameters with programatic variables of appropriate types.
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
I have managed to open reports using the DBDocShortCuts extension and using this to create a shortcut to a report and then assigning the shortcut .bat file to the execute event of a push button. It seems to work.
Windows 10
OOo 4.1.5
connected to
External HSQLDB 2.3.2 DB