HotXLS Docs

OnExportLimit event

Occurs when the exporter is about to split or clamp output because a worksheet limit was reached. Read/write TOnExportLimit

Remarks

The exporter raises this event immediately before it starts a new worksheet because the current row count would exceed RowsPerSheet. It does not cancel the split; it lets the application log the decision or replace the user-facing explanation. Kind names the limited resource, Requested is the value the data wanted, and Limit is the active ceiling. For the RowsPerSheet split, Kind is elkRows, Requested is the next row number, and Limit is RowsPerSheet. ActionDescription starts as a short description such as 'RowsPerSheet split'; changing it affects only what the handler itself decides to show, because the exporter does not read it back. This adapter currently raises only elkRows; elkColumns and elkSheetCount are part of the event's vocabulary for a grid-limit clamp that can exceed a worksheet's column or sheet count

Syntax

TExportLimitKind = (elkRows, elkColumns, elkSheetCount); TOnExportLimit = procedure(Sender: TObject; Kind: TExportLimitKind; Requested, Limit: Integer; var ActionDescription: WideString) of object; property OnExportLimit: TOnExportLimit;

Example

This example records each row-limit split in a memo (include TypInfo in the uses clause for GetEnumName)

procedure TForm1.DataToXLS1ExportLimit(Sender: TObject;
  Kind: TExportLimitKind; Requested, Limit: Integer;
  var ActionDescription: WideString);
begin
  Memo1.Lines.Add(Format('%s: requested %d, limit %d (%s)',
    [GetEnumName(TypeInfo(TExportLimitKind), Ord(Kind)),
     Requested, Limit, ActionDescription]));
end;