EaxAttachmentChangeResult SetDataAreaGridAttachments(string mon, EaxAttachmentPattern tPattern, EaxAttachments tArg)
mon. Moniker of the Table visualizer.
tPattern. Operation execution pattern.
tArg. Attachments that should be linked to a cell.
The SetDataAreaGridAttachments operation changes the list of table cell attachments.
To execute the operation, in the mon field specify moniker of regular report instance with the !DataArea!DataSources!source key!DataSourceSlices!slice key!Views!table key postfix. The moniker can be obtained on executing the OpenPrxMeta operation. In the tPattern field specify coordinates of the cell, which attachments should be changed, and in the tArg field specify a list of attachments ad actions with them.
The operation results in the information about changed attachment.
When a new attachment is added, after executing the SetDataAreaGridAttachments operation the attachment should be loaded to BI server using the PutBin operation. As a moniker for PutBin, specify moniker for SetDataAreaGridAttachments + !Attachments!attachment key. The attachment key will be available in the result of the SetDataAreaGridAttachments operation.
Below is the example of adding a table cell attachment. The request contains table moniker, cell coordinates, and information about the added attachment. The response contains attachment metadata with the key that should be used by the PutBin operation to load file to BI server.
{
"SetDataAreaGridAttachments" :
{
"mon" : "MEIAHFNGIHOCGOAEIHCLFJLBBEPLGOEELKAMEOCBAIKLGBGC!M!S!PJOILJGNGIHOCGOAEGFPAJAHCFFGJOBPEBIDPPGBPPHEIJJHB!DataArea!DataSources!1!DataSourceSlices!1!Views!1",
"tPattern" :
{
"row" : "3",
"column" : "2"
},
"tArg" :
{
"its" :
{
"it" :
[
{
"name" : "readmy",
"type" : "Value",
"fileName" : "readmy.txt",
"date" : "2024-05-15T00:00:00+05:00",
"size" : "100",
"changeType" : "Add"
}
]
}
}
}
}
{
"SetDataAreaGridAttachmentsResult" :
{
"item" :
{
"key" : "4294967196",
"name" : "readmy",
"type" : "Value",
"fileName" : "readmy.txt",
"date" : "2024-05-15T00:00:00.000",
"size" : "100",
"user" : "the ADMIN user"
}
}
}
public static EaxAttachmentChangeResult SetDataAreaGridAttachments(string moniker, uint sourceKey, uint sliceKey, uint viewKey, uint cellRow, uint cellColumn, EaxAttachments attach)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetDataAreaGridAttachments()
{
tPattern = new EaxAttachmentPattern()
{
row = cellRow,
column = cellColumn
},
tArg = attach,
mon = moniker + "!DataArea!DataSources!" + sourceKey.ToString() + "!DataSourceSlices!" + sliceKey.ToString() + "!Views!" + viewKey.ToString()
};
// Change cell attachments
var result = somClient.SetDataAreaGridAttachments(tSet);
return result;
}
See also: