HotXLS 文件

TXLSXStructuralEditRegistry 類別

TXLSXWorksheet.StructuralEditRegistry 在資料列或資料行插入與刪除後協調對參照敏感的更新

內建參與者一律更新 HotXLS 公式、名稱、驗證、條件式格式、註解、超連結、圖案、資料表、查詢繫結、案例、資料表、列印中繼資料、受保護範圍、迷你圖、有型別樞紐分析與可辨識的保留擴充參照

應用程式可為自己的工作表中繼資料註冊有序參與者,而不會取代內建交易

宣告

type
  TXLSXStructuralEdit = record
    RowFrom: Integer;
    RowDelta: Integer;
    ColFrom: Integer;
    ColDelta: Integer;
  end;

  IXLSXStructuralEditParticipant = interface
    procedure ApplyStructuralEdit(Worksheet: TXLSXWorksheet;
      const Edit: TXLSXStructuralEdit);
  end;

  TXLSXStructuralEditRegistry = class
    procedure RegisterParticipant(
      const Participant: IXLSXStructuralEditParticipant);
    procedure UnregisterParticipant(
      const Participant: IXLSXStructuralEditParticipant);
    procedure Clear;
    property Count: Integer;
  end;

編輯欄位

RowFrom受影響的第一個以一為基底資料列;資料列未變更時為零
RowDelta正向的插入資料列數或負向的刪除資料列數
ColFrom受影響的第一個以一為基底資料行;資料行未變更時為零
ColDelta正向的插入資料行數或負向的刪除資料行數

參與者規則

範例

type
  TMetadataUpdater = class(TInterfacedObject,
    IXLSXStructuralEditParticipant)
  public
    procedure ApplyStructuralEdit(Worksheet: TXLSXWorksheet;
      const Edit: TXLSXStructuralEdit);
  end;

Updater := TMetadataUpdater.Create;
Sheet.StructuralEditRegistry.RegisterParticipant(Updater);
Sheet.InsertRows(4, 2);

另請參閱