In Base, I have a simple db setup with a form for entering data. My form has a single press button which opens the current record in a report. From the report (Writer) I usually select File > Send > Email as PDF.
I notice the report has a filename based on the underlying report filename, plus index. I’d like to specify exactly the report filename. Is that possible please?
My database is a simple customer, order type affair. The reports are ‘invoices’ and so I’d like the Writer document filename to include the invoice number.
My press button macro has access to the invoice ref:
invoice_ref = oForm.getString(oForm.findColumn("invoice_ref"))
I open the report like this:
ThisDatabaseDocument.ReportDocuments.getByName("Invoice").open
I tried this but the Name filed is read-only:
nHandle = ThisDatabaseDocument.ReportDocuments.getByName("Invoice")
nHandle.name = "Invoice_" + invoice_ref
Also tried perusing the API docs, but got a little lost!
https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1sdb_1_1XSubDocument.html
Any help much appreciated.