Delete(Value: TabDeleteShiftDirection);
Delete(Value: Prognoz.Platform.Interop.Tab.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.
To execute the example, 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 a regular report for edit
mb := MetabaseClass.Active;
regrep := mb.ItemById("REGULAR_REPORT_ITABSHEET_INSERT_DELETE").Edit As IPrxReport;
// Get cell range (A11:I11)
sheet := regrep.Activesheet;
table := sheet As IPrxTable;
range := table.TabSheet;
diap1 := range.ParseRange("A11:I11");
// Delete the cell range with the offset of cells up
diap1.Delete(TabDeleteShiftDirection.ShiftUp);
// Insert the cell range into the set range with the offset of cells to the 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.
The requirements and result of the Fore.NET Example execution match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetaBase;
regrep: IPrxReport;
sheet: IPrxSheet;
table: IPrxTable;
range: ITabSheet;
diap1: ITabRange;
diap2: ITabRange;
Begin
// Open a regular report for edit
mb := Params.Metabase;
regrep := mb.ItemById["REGULAR_REPORT_ITABSHEET_INSERT_DELETE"].Edit() As IPrxReport;
// Get cell range (A11:I11)
sheet := regrep.Activesheet;
table := sheet As IPrxTable;
range := table.TabSheet;
diap1 := range.ParseRange("A11:I11");
// Delete the cell range with the offset of cells up
diap1.Delete(TabDeleteShiftDirection.tdsdShiftUp);
// Insert the cell range into the set range with the offset of cells to the right
diap2 := range.ParseRange("A4:B4");
diap2.Insert(TabInsertShiftDirection.tisdShiftToRight);
// Save changes
(regrep As IMetabaseObject).Save();
End Sub;
See also: