NativeExcel suite v1.x

AfterExport event

Occurs after the dataset is exported into the Excel.

Description

You can use this event to apply additional formatting to the whole exported area.

Syntax

TAfterExport = procedure (Sender: TObject; Range: IXLSRange) of object;
SenderTObject. Specifies the TDataset2Excel component that triggered the event.
RangeIXLSRange. Represents a range which contains the whole exported area.

Example

This example puts the thick border around the exported area.
procedure TForm1.Dataset2Excel1AfterExport(Sender: TObject;
  Range: IXLSRange);
begin
  With Range.Borders do begin
     Item[xlEdgeBottom].LineStyle := xlContinuous;
     Item[xlEdgeBottom].Weight := xlThick;
     Item[xlEdgeTop].LineStyle := xlContinuous;
     Item[xlEdgeTop].Weight := xlThick;
     Item[xlEdgeLeft].LineStyle := xlContinuous;
     Item[xlEdgeLeft].Weight := xlThick;
     Item[xlEdgeRight].LineStyle := xlContinuous;
     Item[xlEdgeRight].Weight := xlThick;
  end;
end;
Copyright © NikaSoft 2004-2010