bool SetPrxShape(PrxShapeId shapeMon, PrxShapeParams tArg)
shapeMon. Shape moniker.
tArg. Operation execution parameters.
The SetPrxShape operation changes settings of the shape located on a regular report sheet.
To execute the operation, in the shapeMon field specify shape moniker and in the tArg field specify determined settings. The moniker can be created based on the regular report moniker according to the rule: Regular report instance moniker!Sheets!sheet key!Objects!shape identifier.
The operation results in the logical True if the settings were changed successfully.
Below is the example of changing settings of the shape located on a regular report sheet. The request contains shape moniker and background, border, and text gradient fill parameters to be set. The response contains whether settings were changed successfully.
{
"SetPrxShape" :
{
"shapeMon" :
{
"id" : "NIOJJPAOELHBGOAEEIPNMJOEPPNPDKCEFLNNFGPGJHAJAIHA!M!S!PKKFPIABOELHBGOAEKKGBBGANBJNMDDAEDLCBNPPIFFBBMNNG!Sheets!1!Objects!PrxShape1"
},
"tArg" :
{
"bca" :
{
"it" :
[
{
"color" :
{
"@a" : "0",
"@r" : "100",
"@b" : "100",
"@g" : "100"
}
},
{
"color" :
{
"@a" : "0",
"@r" : "200",
"@b" : "200",
"@g" : "200"
}
}
]
},
"bdca" :
{
"it" :
{
"color" :
{
"@a" : "0",
"@r" : "182",
"@b" : "182",
"@g" : "182"
}
}
},
"bw" : "0.5",
"txt" : "Rounded rectangle",
"va" : "0",
"ha" : "1"
}
}
}
{
"SetPrxShapeResult" : "1"
}
public static bool SetPrxShape(string moniker, uint sheetKey, string shapeId)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetPrxShape()
{
shapeMon = new PrxShapeId()
{
id = moniker + "!Sheets!" + sheetKey + "!Objects!" + shapeId
},
tArg = new PrxShapeParams()
{
bca = new GradientColor[] // Gradient background fill
{
new GradientColor()
{
color = new BaseColor()
{ r = 100, rSpecified = true,
g = 100, gSpecified = true,
b = 100, bSpecified = true,
a = 0, aSpecified = true }
},
new GradientColor()
{
color = new BaseColor()
{ r = 200, rSpecified = true,
g = 200, gSpecified = true,
b = 200, bSpecified = true,
a = 0, aSpecified = true }
}
},
bdca = new GradientColor[] // Shape border fill
{
new GradientColor()
{
color = new BaseColor()
{ r = 182, rSpecified = true,
g = 182, gSpecified = true,
b = 182, bSpecified = true,
a = 0, aSpecified = true }
}
},
bw = 0.5f, // Width
txt = "Rounded rectangle", // Text in shape
ha = 1, // Horizontal alignment - Center
va = 0 // Vertical alignment - Top
}
};
// Change shape settings
var result = somClient.SetPrxShape(tSet);
return result;
}
See also: