SaveFormToFile(Form: IForm; FileName: String);
SaveFormToFile(Form: Prognoz.Platform.Interop.Metabase.IForm; FileName: String);
Form is a repository form that should be saved into the file.
FileName is a path and name of the file in which the form is saved.
The SaveFormToFile method saves a form into the indicated file.
The "ppform" extension should be specified for a file in which the form is saved.
Executing the example requires that the repository contains a form with the Form_1" identifier.
Sub UserProc;
Var
MB: IMetabase;
Fs: IForeSerializer;
MObj: IMetabaseObjectDescriptor;
ForeForm: IForm;
Begin
MB := MetabaseClass.Active;
Fs := New ForeSerializer.Create;
MObj := MB.ItemById("Form_1");
ForeForm := MObj.Bind As IForm;
Fs.SaveFormToFile(ForeForm, "c:\" + MObj.Id + ".ppform");
End Sub UserProc;
The specified form is saved in the file in disk C root after executing this example.
Executing the example requires that the repository contains a form with the Form_1" identifier.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.KeFore;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Fs: IForeSerializer = New ForeSerializerClass();
MObj: IMetabaseObjectDescriptor;
ForeForm: IForm;
Begin
MB := Params.Metabase;
MObj := MB.ItemById["Form_1"];
ForeForm := MObj.Bind() As IForm;
Fs.SaveFormToFile(ForeForm, "c:\" + MObj.Id + ".ppform");
End Sub;
This procedure is the entry point for the .NET assembly. The specified form is saved in the file in disk C root when executing the procedure.
See also: