With every addition to fpspreadsheet, the documentation is getting more and more complex, and people are already complaining that the wiki article is too long and loads too slowly over the slow internet. An unsolvable situation...
I absolutely urge you (and everybody) to learn how to navigate the source code. It is always up to date, and I often add lots of comments to describe the functions (the comments are used by the chm help file generator). Please search the forum for "navigate" and my user name - I described the procedure already several times.
There is not yet any "official" documentation for the TCell record helpers. Here is the declaration of the methods:
type
TCellHelper = record helper for TCell
...
public
property BackgroundColor: TsColor
read GetBackgroundColor write SetBackgroundColor;
property BiDiMode: TsBiDiMode
read GetBiDiMode write SetBiDiMode;
property Border: TsCellBorders
read GetBorder write SetBorder;
property Borders[ABorders: TsCellBorders]: TsCellBorderStyle
write SetBorders; // write-only!
property BorderStyle[ABorder: TsCellBorder]: TsCellBorderStyle
read GetBorderStyle write SetBorderStyle;
property BorderStyles: TsCellBorderStyles
read GetBorderStyles write SetBorderStyles;
property CellFormat: TsCellFormat
read GetCellFormat write SetCellFormat;
property Comment: String
read GetComment write SetComment;
property Font: TsFont read GetFont;
property FontIndex: Integer
read GetFontIndex write SetFontIndex;
property HorAlignment: TsHorAlignment
read GetHorAlignment write SetHorAlignment;
property Hyperlink: TsHyperlink
read GetHyperlink write SetHyperlink;
property NumberFormat: TsNumberFormat
read GetNumberFormat write SetNumberFormat;
property NumberFormatStr: String
read GetNumberFormatStr write SetNumberFormatStr;
property TextRotation: TsTextRotation
read GetTextRotation write SetTextRotation;
property UsedFormattingFields: TsUsedFormattingFields
read GetUsedFormattingFields write SetUsedFormattingFields;
property VertAlignment: TsVertAlignment
read GetVertAlignment write SetVertAlignment;
property Wordwrap: Boolean
read GetWordwrap write SetWordwrap;
property Workbook: TsBasicWorkbook read GetWorkbook;
end;
Having unit fpscell in "uses" you can simply set these properties:
var
cell: PCell;
...
cell := worksheet.WriteNumber(1, 2, 3.141592);
cell^.NumberFormatStr := '0.00';
cell^.BackgroundColor := scRed;
cell^.Borders[[cbNorth, cbSourh]] := CellBorderStyle(scRed, scDouble);
A special note should be make for the property Borders (plural) which is write-only. In the above example, the top and bottem borders of the cell are set as red double lines. (Using the color scUndefined or scTransparent as color parameter hides the border line). It does not make sense to read back the cell border styles because the border elements specified in the parameter may be different.