Documentazione HotXLS

AfterExport evento

Occurs after the dbgrid is exported into the Excel

Descrizione

È possibile usare questo evento per applicare una formattazione aggiuntiva all'intera area esportata

Sintassi

TDBGridAfterExport = procedura (Sender: TObject; Range: IXLSRange) of object;
Sender TObject. Specifica the TGridToXLS component that triggered the event
Range IXLSRange. Rappresenta a range which contains the whole exported area

Esempio

This example puts the thick border around the exported area

procedure TForm1.GridToXLS1AfterExport(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;