SaveToStream(Stream: IIOStream; [DimSelectionSet: IDimSelectionSet = Null]);
SaveToStream(Stream: System.IO.Stream; IDimSelectionSet: Prognoz.Platform.Interop.Dimension.IDimSelectionSet);
Stream. This parameter indicates the stream to which the express report is saved.
DimSelectionSet. Selection of dimension elements in the saved report.
The SaveToStream method saves express report to a stream.
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.ppexpress", FileOpenMode.Create, FileShare.Exclusive);
Expr.SaveToStream(Fs, DimSelSet);
End If;
End Sub UserProc;
After executing the example the express report is saved to the stream represented by the C:\EXPRESS_REPORT.ppexpress file. Report selection is set using the Express service option command.
See also: