ShockWaveFlash: IShockWaveFlash;
ShockWaveFlash: IShockWaveFlash;
The ShockWaveFlash property uses properties and methods of the IShockWaveFlash interface to work with a Flash object.
Executing the example requires a regular report with the REGULAR_REPORT identifier, the report active sheet contains only a Flash object. Add links to the Fore, Forms, Io (ForeIO for Fore.NET example), Metabase, Report, Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
CrInfo: IMetabaseObjectCreateInfo;
Doc: IDocument;
MemStr: IMemoryStream;
Sheet: IPrxTable;
Fl: IPrxFlash;
Report: IPrxReport;
Begin
MB := MetabaseClass.Active;
CrInfo := MB.CreateCreateInfo;
CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_DOCUMENT;
CrInfo.Id := "Flash_Document";
CrInfo.Name := "Flash_Document";
CrInfo.Parent := MB.Root;
CrInfo.Permanent := True;
MObj := MB.CreateObject(CrInfo).Edit;
Doc := MObj As IDocument;
Report := MB.ItemById("REGULAR_REPORT").Bind As IPrxReport;
Sheet := Report.ActiveSheet As IPrxTable;
Fl := Sheet.TabSheet.Objects.Item(0).Extension As IPrxFlash;
MemStr := New MemoryStream.Create;
Fl.ShockWaveFlash.SaveToStream(MemStr);
Doc.LoadFromStream(MemStr);
MObj.Save;
Dispose MemStr;
End Sub UserProc;
After executing the example the Flash object located on the regular report active sheet is saved into the Document repository object with the Flash_Document identifier.
The requirements and result of the Fore.NET example execution match with those in the Fore example
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Fore;
Imports Prognoz.Platform.Interop.ForeIO;
Imports Prognoz.Platform.Interop.Forms;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MObj: IMetabaseObject;
CrInfo: IMetabaseObjectCreateInfo;
Doc: IDocumentEx;
MemStr: System.IO.MemoryStream;
Sheet: IPrxTable;
Fl: IPrxFlash;
Report: IPrxReport;
Begin
MB := Params.Metabase;
CrInfo := MB.CreateCreateInfo();
CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_DOCUMENT As Int32;
CrInfo.Id := "Flash_Document";
CrInfo.Name := "Flash_Document";
CrInfo.Parent := MB.Root;
CrInfo.Permanent := True;
MObj := MB.CreateObject(CrInfo).Edit();
Doc := MObj As IDocumentEx;
Report := MB.ItemById["REGULAR_REPORT"].Edit() As IPrxReport;
Sheet := Report.ActiveSheet As IPrxTable;
Fl := Sheet.TabSheet.Objects.Item[0].Extension As IPrxFlash;
MemStr := New System.IO.MemoryStream();
Fl.ShockWaveFlash.SaveToStream(MemStr);
Doc.LoadFromStdStream(MemStr);
MObj.Save();
MemStr := Null;
End Sub;
See also: