Dokumentace HotXLS

Třídy TXLSXRichText a TXLSXRichTextRun

TXLSXRichText uchovává naformátované textové běhy pro TXLSXCell.RichText a rich text komentářů v XLSX fasádě

Deklarace

type
  TXLSXRichText = class
    function AddRun: TXLSXRichTextRun;
    function AddRunText(const AText: WideString): TXLSXRichTextRun;
    procedure Clear;
    function PlainText: WideString;
    property RunCount: Integer;
    property Runs[Index: Integer]: TXLSXRichTextRun;
  end;

  TXLSXRichTextRun = class
    property Text, Name: WideString;
    property Size: Double;
    property Bold, Italic, Strikethrough, ColorIsAuto: Boolean;
    property Underline: TXLSXUnderline;
    property Color: LongWord;
    property VertAlign: TXLSXFontVertAlign;
  end;

Klíčové členy

AddRun and AddRunTextPřipojí prázdný běh, nebo běh s počátečním textem
PlainTextVrátí zřetězený text bez informací o stylu
Name, Size, Bold, Italic and StrikethroughRodina a velikost písma a základní stylové atributy jednoho běhu
Underline, Color and ColorIsAutoVolby podtržení a barvy běhu
VertAlignSvislé zarovnání baseline, subscript nebo superscript

Příklad

var Rich: TXLSXRichText;
begin
  Rich := TXLSXRichText.Create;
  Rich.AddRunText('Quarterly ');
  Rich.AddRunText('Report').Bold := True;
  Sheet.Cells[1, 1].RichText := Rich;
end;

Viz také