CreateAttachmentsPluginContext(Row: Integer; Column: Integer): IEaxAttachmentsPluginContext;
CreateAttachmentsPluginContext(Row: Integer; Column: Integer): Prognoz.Platform.Interop.Express.IEaxAttachmentsPluginContext;
Row. Cell row index.
Column. Column cell index.
The CreateAttachmentsPluginContext method creates a context for working with cell attachments.
The obtained context is specified as a value of the IUiCommandExecutionContext.Data property on working with the ShowAttachmentsDialog command.
Executing the example requires that the repository contains an express report with the EXPRESS_REPORT identifier. The data source for the express report is set up to work with attachments.
Add links to the Express, Metabase, Ui system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Eax: IEaxAnalyzer;
Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
EaxContext: IEaxAttachmentsPluginContext;
Grid: IEaxGrid;
Begin
MB := MetabaseClass.Active;
Eax := MB.ItemById("EXPRESS_REPORT").Edit As IEaxAnalyzer;
Target := WinApplication.Instance.GetPluginTarget("Report");
Context := Target.CreateExecutionContext;
Grid := Eax.Grid;
EaxContext := Eax.Grid.CreateAttachmentsPluginContext(5, 5);
Context.Data := EaxContext;
Target.Execute("ShowAttachmentsDialog", Context);
(Eax As IMetabaseObject).Save;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Ui;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Eax: IEaxAnalyzer;
WinApp: WinApplication = New WinApplicationClass_2();
Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
EaxContext: IEaxAttachmentsPluginContext;
Grid: IEaxGrid;
Begin
MB := Params.Metabase;
Eax := MB.ItemById["EXPRESS_REPORT"].Edit() As IEaxAnalyzer;
Target := WinApp.GetPluginTarget("Report");
Context := Target.CreateExecutionContext();
Grid := Eax.Grid;
EaxContext := Eax.Grid.CreateAttachmentsPluginContext(5, 5);
Context.Data := EaxContext;
Target.Execute("ShowAttachmentsDialog", Context, Null);
(Eax As IMetabaseObject).Save();
End Sub;
On executing the example, a dialog box for working with attachments opens for the specified cell. After finishing the work with attachments, the express report is saved.
See also: