เอกสาร 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แถวแรกแบบ 1-based ที่ได้รับผลกระทบ หรือศูนย์เมื่อแถวไม่เปลี่ยนแปลง
RowDeltaจำนวนแถวที่แทรกเป็นบวกหรือจำนวนแถวที่ลบเป็นลบ
ColFromคอลัมน์แรกแบบ 1-based ที่ได้รับผลกระทบ หรือศูนย์เมื่อคอลัมน์ไม่เปลี่ยนแปลง
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);

ดูเพิ่มเติม