Clear;
The Clear method deletes layout structure.
Sub Main;
Var
MB: IMetabase;
MObj : IMetabaseObject;
Report : IPrxReport;
TabIs : IPrxTableIslands;
TI : IPrxTableIsland;
Range : ITabRange;
Layout : IPrxTableIslandLayout;
Row : IPrxTableIslandLayoutRow;
Cell : IPrxTableIslandLayoutCell;
SourceFields : IDalCursorFields;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("Report").Edit;
Report := MObj As IPrxReport;
TabIs := Report.TableIslands;
TI := TabIs.Item(0);
TI := TI.Edit;
TI.Source := Report.TableSources.Item(0);
TI.Sheet := Report.Sheets.Item(0);
Range := (TI.Sheet As IPrxTable).TabSheet.Cell(10,1);
TI.Range := Range;
Layout := TI.Layout;
Layout.Clear;
Row := Layout.Add;
Cell := Row.Add;
SourceFields := Report.TableSources.Item(0).Execute.Fields;
Cell.Field.FieldName := SourceFields.Item(0).Name;
Cell := Row.Add;
Cell.Field.FieldName := SourceFields.Item(1).Name;
TI.Save;
MObj.Save;
End Sub Main;
After executing the example a relational data area with the specified layout parameters is added to a sheet of the regular report. Report - identifier of a regular report.
See also: