The SetViewerLicenses method allows you to limit the number of Report Viewer licenses available to users. This is usually used when you have an unlimited Report Viewer license but only want the users to access a certain number of them (for example, one per license of your application they have purchased).

Syntax

SetViewerLicenses(Licences as Integer)

Parameters
Licenses
The number of Report Viewer licenses desired.

Return Value
None.

Example
Here's an example that allows only one Report Viewer license. This code would go in the Application.AfterSetup script.

Visual FoxPro

lparameters toApplication as SQApplication
toApplication.SetViewerLicenses(1)
return .T.

VBScript

function Main(Application)
Application.SetViewerLicenses(1)
Main = true;
end function

JavaScript

function Main(Application, Directory) {
Application.SetViewerLicenses(1);
return true;
}

C#

The method in this script must be named Application_AfterSetup.

public static bool Application_AfterSetup(SFQApplication sfqApplication)
{	
  sfqApplication.SetViewerLicenses(1);
  return true;
}

VB.NET

The method in this script must be named Application_AfterSetup.

public shared function Application_AfterSetup(sfqApplication as SFQApplication) as Boolean
  sfqApplication.SetViewerLicenses(1)
  Return True
End Function

See also

Application Object

© Stonefield Software Inc., 2023 • Updated: 02/15/17
Comment or report problem with topic