SaveToStream(Stream: System.IO.Stream; IDimSelectionSet: Prognoz.Platform.Interop.Dimensions.IDimSelectionSet);
Stream: the stream to which the express report is saved.
DimSelectionSet: selection of dimension element in the saved report.
The SaveCubeToStream method saves data of selected express report dimensions to a stream as a cube.
Executing the example requires that the repository contains an express report with the EXPRESS_REPORT identifier.
Sub UserProc;
Var
Fs: IFileStream;
DimSelSet: IDimSelectionSet;
Context: IUiCommandExecutionContext;
CommandTarget: IUiCommandTarget;
mb: IMetabase;
Expr: IEaxAnalyzer;
Begin
CommandTarget := WinApplication.Instance.GetPluginTarget("EXPRESS_REPORT");
Context := CommandTarget.CreateExecutionContext;
mb := MetabaseClass.Active;
Expr := mb.ItemById("EXPRESS_REPORT").Bind As IEaxAnalyzer;
Context.Data := Expr As Variant;
DimSelSet := CommandTarget.Execute("DimSelectionSetup", Context);
If (DimSelSet <> Null) Then
Fs := New FileStream.Create("C:\EXPRESS_REPORT_C.p5c", FileOpenMode.Create, FileShare.Exclusive);
Expr.SaveToStream(Fs, DimSelSet);
End If;
End Sub UserProc;
After executing this example the express report is saved to the stream represented by the C:\EXPRESS_REPORT_C.p5c file as a cube. Report selection is set using the following command: Express service option .
See also: