bool TabPaintFormat(TabSheetId tTabSheet, TabPaintFormatArgs tArg)
tTabSheet. Moniker of the table, in which cell range formatting is pasted.
tArg. Operation execution parameters.
The TabPaintFormat operation copies formatting from one cell range to another cell range.
To execute the operation, in the tTabSheet field specify table moniker, and in the tArg field specify format copy parameters. 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.
The operation results in the logical true if the formatting is copied successfully.
Below is the example of copying formatting from one range to another range. Copying is executed within the same sheet. The request contains table moniker, the cell range, from which formatting is copied, and the cell range, for which the copied formatting is applied. The response contains whether cell formatting is copied successfully.
{
"TabPaintFormat" :
{
"tTabSheet" :
{
"id" : "DJDINJDAHBDFGOAEJGMHIDGBBBECGIMEIKPHMNGNGOLDEPKK!M!S!PKDOKANDAHBDFGOAECAJHLMIOFHLOEMAELLJEFFONACLGHACB!1"
},
"tArg" :
{
"src" :
{
"left" : "0",
"top" : "0",
"width" : "2",
"height" : "2",
"type" : "Cells"
},
"dst" :
{
"left" : "4",
"top" : "0",
"width" : "2",
"height" : "2",
"type" : "Cells"
},
"k" : "1"
}
}
}
{
"TabPaintFormatResult" : "1"
}
public static bool TabPaintFormat(string moniker, uint sheetKey)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tFormat = new TabPaintFormat()
{
tArg = new TabPaintFormatArgs()
{
src = new TabComplexRange()
{
left = 0,
top = 0,
width = 2,
height = 2,
type = TabRangeType.Cells
},
dst = new TabComplexRange()
{
left = 4,
top = 0,
width = 2,
height = 2,
type = TabRangeType.Cells
},
k = sheetKey
},
tTabSheet = new TabSheetId() { id = moniker + "!" + sheetKey }
};
// Copy formatting of one cell range to another cell range
var result = somClient.TabPaintFormat(tFormat);
return result;
}
See also: