StyleSheet: IStyleSheet;
The InnerStyleSheet property returns the internal styles table.
The internal styles table can be used to store proper dashboard styles. An external styles table can be also connected for work. To do this, use the IAdhocReport.StyleSheet property.
Executing the example requires that the repository contains a dashboard with the DASHBOARD identifier.
Add links to the Adhoc, Drawing, Metabase, Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
AdhocReport: IAdhocReport;
StyleSheet: IStyleSheet;
Style: IStyleContainer;
TabSt: ITabCellStyle;
Begin
MB := MetabaseClass.Active;
AdhocReport := MB.ItemById("DASHBOARD").Edit As IAdhocReport;
StyleSheet := AdhocReport.InnerStyleSheet;
StyleSheet.Clear;
Style := StyleSheet.Add;
// New style
TabSt := New TabCellStyle.Create;
TabSt.Font.Name := "Times New Roman";
TabSt.Font.Size := 16;
TabSt.Font.Color := GxColor.FromName("Red");
// Save style
(TabSt As IStyledEntity).SaveStyleToContainer(Style);
(AdhocReport As IMetabaseObject).Save;
End Sub UserProc;
After executing the example, a new text style is created in the internal styles table. All existing styles are deleted before creating.
See also: