Modifying/adding/deleting a style
Modifying a style with the given name:
Pascal:
var
Style: TfrxStyleItem;
Styles: TfrxStyles;
Styles := frxReport1.Styles;
{ search for a style}
Style := Styles.Find('Style1');
{ modify the font size }
Style.Font.Size := 12;
C++:
TfrxStyleItem * Style;
TfrxStyles * Styles;
Styles = frxReport1->Styles;
// search for a style
Style = Styles->Find("Style1");
// modify the font size
Style->Font->Size = 12;
Adding a style to the report styles set:
Pascal:
var
Style: TfrxStyleItem;
Styles: TfrxStyles;
Styles := frxReport1.Styles;
{ add }
Style := Styles.Add;
Style.Name := 'Style3';
C++:
TfrxStyleItem * Style;
TfrxStyles * Styles;
Styles = frxReport1->Styles;
// add
Style = Styles->Add();
Style->Name = "Style3";
Deleting a style with a given name:
Pascal:
var
Style: TfrxStyleItem;
Styles: TfrxStyles;
Styles := frxReport1.Styles;
{ delete }
Style := Styles.Find('Style3');
Style.Free;
C++:
TfrxStyleItem * Style;
TfrxStyles * Styles;
Styles = frxReport1->Styles;
// delete
Style = Styles->Find("Style3");
delete Style;
After modifications are accomplished, you should call the Apply
method:
{ use modifications }
frxReport1.Styles.Apply;