CloneStyleSheetItem

Syntax

StyleSheetItemMetadata CloneStyleSheetItem(string mon)

Parameters

mon. Moniker of single style in styles table.

Description

The CloneStyleSheetItem operation creates a style clone in styles table.

Comments

To execute the operation, in the mon field specify moniker of opened styles table instance with the !<style number> postfix. The moniker can be obtained on executing the OpenStyleSheet operation.

The operation results in the metadata of created style clone.

Example

Below is the example of creating a style clone in styles table. The request contains style moniker. The response contains information about the created style.

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">
<CloneStyleSheetItem xmlns="http://www.fsight.ru/PP.SOM.Som">
  <mon xmlns="">CPDKLBGLHHOOFOAEEOBMIPONHEFJBEBEOLJEMAEIDCPLAAGC!M!S!SDJNKBJGLHHOOFOAENACKGIKGBKMHOKOEOJBIKCBEOKJJAPGE!2</mon>
  </CloneStyleSheetItem>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<CloneStyleSheetItemResult 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">
<h xmlns="">
  <key>3</key>
  <tag>TAB</tag>
<name>Style1 (copy 1)</name>
  <id>I3</id>
  </h>
<style UNS="2">
  <Text HA="-1" VA="-1" WW="-1" Mmm="-1.00 -1.00 -1.00 -1.00" />
  <Font F="Arial" S="12" I="true" H="18" />
  <Borders />
  <Hyperlink />
  <ContainerInfo key="3" sheetType="0" />
  </style>
  </CloneStyleSheetItemResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"CloneStyleSheetItem" :
{
"mon" : "CPDKLBGLHHOOFOAEEOBMIPONHEFJBEBEOLJEMAEIDCPLAAGC!M!S!SDJNKBJGLHHOOFOAENACKGIKGBKMHOKOEOJBIKCBEOKJJAPGE!2"
}
}

JSON response:

{
"CloneStyleSheetItemResult" :
{
"h" :
{
"key" : "3",
"tag" : "TAB",
"name" : "Style1 (copy 1)",
"id" : "I3"
},
"style" :
{
"@UNS" : "2",
"Text" :
{
"@VA" : "-1",
"@Mmm" : "-1.00 -1.00 -1.00 -1.00",
"@HA" : "-1",
"@WW" : "-1"
},
"Font" :
{
"@S" : "12",
"@F" : "Arial",
"@H" : "18",
"@I" : "true"
},
"Borders" : "",
"Hyperlink" : "",
"ContainerInfo" :
{
"@key" : "3",
"@sheetType" : "0"
}
}
}
}
public static StyleSheetItemMetadata CloneStyleSheetItem(string moniker, ulong styleNumber)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tClone = new CloneStyleSheetItem()
{
mon = moniker + '!' + styleNumber
};
// Clone style
var result = somClient.CloneStyleSheetItem(tClone);
return result;
}

See also:

Working with Styles Table