oreportdoc = thisdatabasedocument.reportdocuments.getbyname("NAME_OF_YOUR_REPORT")
oreport = oreportdoc.open
MRI oreport
...
Sub NormalReport
'--------------------------------------------------------------------
' 0 We declare the variables
Dim oreportdoc As Object, ocontroller As Variant
Dim oTextTable As Variant, oCell As Variant
Dim oCurs As object, oText As Variant
'------------------------------------------------------------------------------
'1º We open our report
ocontroller = Thisdatabasedocument.currentController
if not ocontroller.isconnected then ocontroller.connect ' The connection
oreportdoc = Thisdatabasedocument.reportdocuments.getbyname("COMARCAS").open ' We open the report
Call "Your macro"
End Sub
sub main
sReportName = "Addressdata"
sExtension = ".odt"
oActiveFrame = Stardesktop.activeFrame
do
wait 10
loop while ismissing(Stardesktop.currentComponent)
if instr(oActiveFrame.Title,sReportName) > 0 AND instr(oActiveFrame.Title,sExtension ) > 0 Then
print "Report """ & sReportName & """ is loaded"
oLoadedReportComponent = Stardesktop.currentComponent
mri oLoadedReportComponent
endif
end sub
arfgh wrote:Calling MR Villeroy....
F3K Total wrote:Bind it to the .odb's event "Deactivate Document"
- Code: Select all Expand viewCollapse view
sub main
sReportName = "Addressdata"
sExtension = ".odt"
oActiveFrame = Stardesktop.activeFrame
do
wait 10
loop while ismissing(Stardesktop.currentComponent)
if instr(oActiveFrame.Title,sReportName) > 0 AND instr(oActiveFrame.Title,sExtension ) > 0 Then
print "Report """ & sReportName & """ is loaded"
oLoadedReportComponent = Stardesktop.currentComponent
mri oLoadedReportComponent
endif
end sub
Users browsing this forum: No registered users and 3 guests