Stonefield Query calls the Application.ReportsExplorerActivated script when the Reports Explorer is activated: at application startup and whenever another dialog is closed and it receives focus.

Parameters
A reference to the Stonefield Query Application object.

Return Value
Any value (Stonefield Query ignores the return value).

Example
Suppose you want to disable editing or creating reports if Stonefield Query hasn't been activated. The following script in Application.ReportsExplorerActivated does this.

Visual FoxPro

lparameters toApplication as SQApplication
if SQApplication.Users.GetLicenseCount() = 0
  SQApplication.CanEditReports = .F.
endif

VBScript

function Main(Application)
if SQApplication.Users.GetLicenseCount() = 0 then
  SQApplication.CanEditReports = False
end if
end function

JavaScript

function Main(Application) {
if (SQApplication.Users.GetLicenseCount() = 0)
  { SQApplication.CanEditReports = false ; }
}

C#

Please note that the method in this script must be named Application_ReportsExplorerActivated.

public static void Application_ReportsExplorerActivated(SFQApplication sfqApplication)
{	
  if (sfqApplication.Users.GetLicenseCount(0) == 0)
  { 
    sfqApplication.CanEditReports = false; 
  }
}

VB.NET

Please note that the method in this script must be named Application_ReportsExplorerActivated.

public shared function Application_ReportsExplorerActivated(sfqApplication as SFQApplication) as Boolean
  if (sfqApplication.Users.GetLicenseCount(0) = 0)
    sfqApplication.CanEditReports = false
  end if
  Return True
End Function

See also

Application.ReportsExplorerReady | Scripts

© Stonefield Software Inc., 2024 • Updated: 06/06/16
Comment or report problem with topic