Below is the example of using the SetWbkMd operation to change cell style. The request contains an instance of opened workbook and changed cell styles. The response contains instance of the workbook to be changed.
{
"SetWbkMd" :
{
"tWbk" :
{
"id" : "S1!M!S!W9"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"useGridAutoAdjust" : "true",
"styles" : "true"
},
"meta" :
{
"styles" :
{
"splice" :
{
"tabStyle" :
{
"Font" :
{
"@C" : "#FF6A00"
}
},
"setDefault" : "false"
},
"discrepancy" :
{
"tabStyle" :
{
"Font" :
{
"@I" : "true"
}
},
"setDefault" : "false"
},
"forecast" :
{
"tabStyle" :
{
"Font" :
{
"@B" : "true"
}
},
"setDefault" : "false"
}
}
}
}
}
}
{
"SetWbkMdResult" :
{
"id" :
{
"id" : "S1!M!S!W9"
}
}
}
public static SetWbkMdResult SetWbkStyle(WbkId wbk)
{// Set operation execution parameters
var tOp = new SetWbkMd
{
tWbk = wbk,
tArg = new SetWbkMdArg
{ // Set pattern for changing data
pattern = new WbkMdPattern()
{styles = true},
// Set data to be changed
meta = new WbkMd()
{
styles = new LnTabStyles()
{// Style for cells with forecasting data
forecast = new LnCellStyle()
{
setDefault = false,
tabStyle = new TabStyle()
{
Font = new TabFontStyle
{
BSpecified = true,
B = true
}
}
},// Style for cells that are data source for spliced series
splice = new LnCellStyle()
{
setDefault = false,
tabStyle = new TabStyle()
{
Font = new TabFontStyle
{C = "#FF6A00"}
}
},// Style for cells, which stored values differ from calculated
discrepancy = new LnCellStyle()
{
setDefault = false,
tabStyle = new TabStyle()
{
Font = new TabFontStyle
{
I = true,
ISpecified = true
}
}
}
}
}
}
};
// Create a proxy object for operation execution
var somClient = new SomPortTypeClient();
// Execute operation
var sRes = somClient.SetWbkMd(tOp);
return sRes;
}
See also: