Using the example of the Openform macro by RPG, I am attempting to adapt the code to open a filtered report from a button located inside a form
The code to date is:
Code: Select all
Sub OpenInvoice(oEvent)
' declare my constants
sReportName= "rptInvoice"
sControlName="fmtInvNumber"
sInvoiceNumber= "Numéro de Facture"
' declare my Variables
dim oButton 'get the button name
dim oForm 'get the calling form name
dim oControl 'get the invoice number control in the form to filter the report
'get the button name in the calling form
oButton=oEvent.source.model
'get the calling form name
oform=oButton.parent
'get the invoice number control to extract value for filter
oControl=oForm.getbyname(sControlName)
'to obtain the content use – oControl.text
' Open the Report
oReport = ThisDatabaseDocument.reportDocuments.getbyname(sReportName).open
oReportData=oReport.drawpage.reports.getbyname(sReportName) '-> This line does not work !!!
'filter the report
dim sFilter
sFilter= chr(34) & sInvoiceNumber & chr(34) & CHR(61)& chr(39) & oControl.TEXT & chr(39)
oReportData.filter=sFilter
oReportData.applyfilter=true
oReportData.reload
End Sub
To date all the reading data I have gathered does not answer these questions.
The other option (much more complicated) is to load a temp table connected to the report before I open the said report.
Liamdale