SetTabProtection

Syntax

SetTabProtectionResult SetTabProtection(TabSheetId tTabSheet, TabProtectionExArg tArg)

Parameters

tTabSheet. Sheet table moniker.

tArg. Operation execution parameters.

Description

The SetTabProtection operation changes regular report sheet table protection.

Comments

To execute the operation, in the tTabSheet field specify table moniker, and in the tArg field specify set protection parameters. The moniker is specified in the following format: Regular report instance moniker!sheet key. To remove protection, in the tArg.protection field specify the value that does not contain the element that is responsible for activation (element with the 1 value).

The operation results in the logical value that determines whether sheet table protection is changed.

Example

Below is the example of setting regular report sheet table protection. The request contains sheet moniker, required protection level, and password. The response contains whether protection is successfully changed.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SetTabProtection xmlns="http://www.fsight.ru/PP.SOM.Som">
<tTabSheet xmlns="">
  <id>NIKLFCDENADGGOAEENCHFLADKBGCAHKEIJNDAILBBLMMBJMM!M!S!POJMOCFDENADGGOAELFPMGJIFMKJKLIFEMIAAHNPBJKILIHJL!Sheets!2</id>
  </tTabSheet>
<tArg xmlns="">
  <protection>33</protection>
  <password>password</password>
  </tArg>
  </SetTabProtection>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetTabProtectionResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <isSuccessful xmlns="">1</isSuccessful>
  </SetTabProtectionResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetTabProtection" :
{
"tTabSheet" :
{
"id" : "NIKLFCDENADGGOAEENCHFLADKBGCAHKEIJNDAILBBLMMBJMM!M!S!POJMOCFDENADGGOAELFPMGJIFMKJKLIFEMIAAHNPBJKILIHJL!Sheets!2"
},
"tArg" :
{
"protection" : "33",
"password" : "password"
}
}
}

JSON response:

{
"SetTabProtectionResult" :
{
"isSuccessful" : "1"
}
}
public static SetTabProtectionResult SetTabProtection(string moniker, string sheetKey, string secPassword)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetTabProtection()
{
tArg = new TabProtectionExArg()
{
password = secPassword,
protection = 33 // Protection activated (1) + Enable table objects editing (32)
},
tTabSheet = new TabSheetId() { id = moniker + "!Sheets!" + sheetKey }
};
// Set sheet protection
var result = somClient.SetTabProtection(tSet);
return result;
}

See also:

Working with Regular Reports