Style

Top  Previous  Next

Style : string;

 

Property Style buňky udržuje název stylu, který se uplatní při vykreslování buňky. Styl buňky zastřešuje všechny vizuální vlastnosti buňky ( TReportStyleItem ) a umožňuje jedním přiřazením nastavit všechny vlastnosti najednou.

 

 

Typ zobrazovaných dat

Format : TfrxFormat

 

 

FormatStr

 

%g – a number with the minimal signs number after decimal point

%2.2f – a number with the fixed number of signs after decimal point

%2.2n – a number with bits delimiter

%2.2m – a monetary format, accepted in the Windows OS, depending on the regional

settings in the control panel.

for the date/time format:

dd.mm.yyyy – date of the 23.12.2003 type

dd mmm yyyy – date of the 23 Nov. 2003 type

dd mmmm yyyy – date of the 23 November 2003 type

hh:mm – time of the 23:12 type

hh:mm:ss – time of the 23:12:00 type

dd mmmm yyyy, hh:mm – time and date of the 23 November 2003, 23:12 type

 

TfrxFormatKind = fkText, fkNumeric, fkDateTime, fkBoolean

 

 

Vytvoření nového stylu pomocí skriptu:

var

 Style: TReportStyleItem;

 Styles: TReportStyles;

begin

 Styles := ReportProperty.Styles;

 With Styles.Add do

 begin            

   Name := 'StyleY';

   Background:=$00CAE4FF;

  Format :=6;

   Font.Style:=fsBold;

   DisplayFormat.FormatStr:='%2.n';

   DisplayFormat.Kind:=fkNumeric;                                                                        

 end;                  

 

potom můžeme použít:

 

Sheet.CellProperty('A1').Style:='StyleY';