HotXLS Docs

OnExportLimit event

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

Remarks

The exporter fires this event immediately before it starts a new worksheet, because the current row count would otherwise exceed RowsPerSheet. It does not cancel the split; it gives the application a chance to 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 out as a short description such as 'RowsPerSheet split'; changing it affects only what the handler itself chooses to display, because the exporter never reads it back. This adapter currently raises elkRows only; elkColumns and elkSheetCount belong to 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 logs each row-limit split to a memo (add TypInfo to 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;