CreateStyleSheetItem

Syntax

StyleSheetItemMetadata CreateStyleSheetItem(StyleSheetId tStyleSheet)

Parameters

tStyleSheet. Moniker of opened styles table instance.

Description

The CreateStyleSheetItem operation creates a styles in styles table.

Comments

To execute the operation, in the tStyleSheet field specify moniker of opened styles table instance. The moniker can be obtained on executing the OpenStyleSheet operation.

The operation results in the metadata of created style.

The further work with a single style is executed using the GetStyleSheetItem/SetStyleSheetItem operations.

Example

Below is the example of creating a style in styles table. The request contains moniker of opened styles table instance. 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">
<CreateStyleSheetItem xmlns="http://www.fsight.ru/PP.SOM.Som">
<tStyleSheet xmlns="">
  <id>CPDKLBGLHHOOFOAEEOBMIPONHEFJBEBEOLJEMAEIDCPLAAGC!M!S!SDJNKBJGLHHOOFOAENACKGIKGBKMHOKOEOJBIKCBEOKJJAPGE</id>
  </tStyleSheet>
  </CreateStyleSheetItem>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<CreateStyleSheetItemResult 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>2</key>
  <tag>TAB</tag>
<name>Style1</name>
  <id>I2</id>
  </h>
<style B="" UNS="0">
  <Text HA="0" VA="0" WW="0" Mmm="0.65 0.65 0.65 0.65" />
  <NumberFormat F="" FT="0" />
  <Font F="Arial" S="8" C="#000000" A="0" TR="0" I="false" B="false" U="false" SO="false" H="12" />
<Borders>
  <Border I="0" S="7" C="#000000" W="2" />
  <Border I="1" S="7" C="#000000" W="2" />
  <Border I="2" S="7" C="#000000" W="2" />
  <Border I="3" S="7" C="#000000" W="2" />
  <Border I="4" S="7" C="#000000" W="2" />
  <Border I="5" S="7" C="#000000" W="2" />
  <Border I="6" S="7" />
  <Border I="7" S="7" />
  </Borders>
  <PictureData E="false" />
  <Hyperlink T="" A="" />
  <ContainerInfo key="2" sheetType="0" />
  <Other DEA="" DZA="" P="1" L="0" FH="0" H="" />
  </style>
  </CreateStyleSheetItemResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"CreateStyleSheetItem" :
{
"tStyleSheet" :
{
"id" : "CPDKLBGLHHOOFOAEEOBMIPONHEFJBEBEOLJEMAEIDCPLAAGC!M!S!SDJNKBJGLHHOOFOAENACKGIKGBKMHOKOEOJBIKCBEOKJJAPGE"
}
}
}

JSON response:

{
"CreateStyleSheetItemResult" :
{
"h" :
{
"key" : "2",
"tag" : "TAB",
"name" : "Style1",
"id" : "I2"
},
"style" :
{
"@B" : "",
"@UNS" : "0",
"Text" :
{
"@VA" : "0",
"@Mmm" : "0.65 0.65 0.65 0.65",
"@HA" : "0",
"@WW" : "0"
},
"NumberFormat" :
{
"@F" : "",
"@FT" : "0"
},
"Font" :
{
"@A" : "0",
"@B" : "false",
"@SO" : "false",
"@S" : "8",
"@C" : "#000000",
"@U" : "false",
"@F" : "Arial",
"@TR" : "0",
"@H" : "12",
"@I" : "false"
},
"Borders" :
{
"Border" :
[
{
"@S" : "7",
"@C" : "#000000",
"@W" : "2",
"@I" : "0"
},
{
"@S" : "7",
"@C" : "#000000",
"@W" : "2",
"@I" : "1"
},
{
"@S" : "7",
"@C" : "#000000",
"@W" : "2",
"@I" : "2"
},
{
"@S" : "7",
"@C" : "#000000",
"@W" : "2",
"@I" : "3"
},
{
"@S" : "7",
"@C" : "#000000",
"@W" : "2",
"@I" : "4"
},
{
"@S" : "7",
"@C" : "#000000",
"@W" : "2",
"@I" : "5"
},
{
"@S" : "7",
"@I" : "6"
},
{
"@S" : "7",
"@I" : "7"
}
]
},
"PictureData" :
{
"@E" : "false"
},
"Hyperlink" :
{
"@A" : "",
"@T" : ""
},
"ContainerInfo" :
{
"@key" : "2",
"@sheetType" : "0"
},
"Other" :
{
"@P" : "1",
"@H" : "",
"@DEA" : "",
"@L" : "0",
"@FH" : "0",
"@DZA" : ""
}
}
}
}
public static StyleSheetItemMetadata CreateStyleSheetItem(string moniker)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tCreate = new CreateStyleSheetItem()
{
tStyleSheet = new StyleSheetId() { id = moniker }
};
// Create a style in styles table
var result = somClient.CreateStyleSheetItem(tCreate);
return result;
}

See also:

Working with Styles Table