bool ChangeTabTableStyleByName(TabSheetId tTabSheet, TabTableStyle tArg, string newName)
tTabSheet. Table moniker.
tArg. Updated style settings to be applied.
newName. New name that will be set for a style.
The ChangeTabTableStyleByName operation changes settings of a style with the specified name.
To execute the operation, in the tTabSheet field specify table moniker and in the tArg field specify updated style settings. The moniker can be based on the moniker of opened object instance, the table of which is worked with, following the rules:
'Express report instance moniker'!Tab. Express report table (if express report has one sheet).
'Express report instance moniker'!Sheets!'Sheet key'!Tab. table of specified express report sheet (if express report has several sheets).
'Workbook instance moniker'!Tab. Workbook table (if workbook has one sheet).
'Workbook instance moniker'!Sheets!'Sheet key'!Tab. Table of specified workbook sheet (if workbook has several sheets).
'Workbook instance moniker'!CorrTab. Table with correlation matrix.
'Workbook instance moniker'!CoeffTab. Table with equation coefficients.
'Workbook instance moniker'!WeightsTab. Table with weight matrix.
'Regular report instance moniker'!Sheet key. Table of specified regular report sheet.
Name of the changed style is specified in the tArg.Name field. If the style should be renamed, specify new name in the newName field.
The operation results in the logical True if the style was changed successfully.
Below is the example of changing table style. The request contains moniker of the table, name of the changed style and new settings of alternating style. A new name is also set for the style. The response contains whether style are successfully changed.
{
"ChangeTabTableStyleByName" :
{
"tTabSheet" :
{
"id" : "JMHNJCPPENOAGOAEKKAIOMBCNHKFGLBECJGOILNNKEBNHDNH!M!S!POMEOEHPPENOAGOAEHHAFJNMHPFBDKBJEDIHOKONCJJDDJEHC!Sheets!1"
},
"tArg" :
{
"Name" : "EAX table style",
"PredefinedStyle" : "DarkRed"
},
"newName" : "EAX table style(changed)"
}
}
{
"ChangeTabTableStyleByNameResult" : "1"
}
public static bool ChangeTabTableStyleByName(string moniker, string sheetKey, string styleName)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tChange = new ChangeTabTableStyleByName()
{
tTabSheet = new TabSheetId() { id = moniker + "!Sheets!" + sheetKey },
tArg = new TabTableStyle()
{
Name = styleName,
PredefinedStyle = TabTablePredefinedStyle.DarkRed
},
newName = styleName + "(changed)"
};
// Change style
var result = somClient.ChangeTabTableStyleByName(tChange);
return result;
}
See also: