Delete(Value: TabDeleteShiftDirection);
Value. Method of deleting cell range.
The Delete method deletes the set cell range.
To insert the required cell range, use the ITabRange.Insert method.
Executing the example requires that the repository contains a regular report with the REGULAR_REPORT_ITABSHEET_INSERT_DELETE identifier. The regular report must contain the cell range A0:I12 filled with any values.
Executing the example requires to add links to the Metabase, Report, Tab system assemblies.
Sub UserProc;
Var
mb: IMetaBase;
regrep: IPrxReport;
sheet: IPrxSheet;
table: IPrxTable;
range: ITabSheet;
diap1: ITabRange;
diap2: ITabRange;
Begin
// Open regular report for edit
mb := MetabaseClass.Active;
regrep := mb.ItemById("REGULAR_REPORT_ITABSHEET_INSERT_DELETE").Edit As IPrxReport;
// Get the cell range (A11:I11)
sheet := regrep.Activesheet;
table := sheet As IPrxTable;
range := table.TabSheet;
diap1 := range.ParseRange("A11:I11");
// Delete cell range with cell shift up
diap1.Delete(TabDeleteShiftDirection.ShiftUp);
// Insert cell range to the specified range with cell shift right
diap2 := range.ParseRange("A4:B4");
diap2.Insert(TabInsertShiftDirection.ShiftToRight);
// Save changes
(regrep As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the cell range A12:A11 is offset by one row up, and the range A5:I5 is offset by two cells to the right.
See also: