Define colors for a configured report

In configured report definitions, you can use styles for coloring when the color is derived from a query.

All parts of the custom theme configuration are not only configuration objects but also stored in the Alfabet database. In the query of a configured report, you can return the value of a style attribute read from the relevant database table.

Create styles for coloring of the report.

  1. Go to the Reusable Elements tab.
  2. Right-click the User Interface Groups node and select Create New Style Group.
  3. Click the new style group node and set the attributes:
    • Name: Change the name to a meaningful name for display in the style selector in Alfabet Expand.
    • Caption: Change the caption to a meaningful caption for display in the Alfabet user interface in the views to edit the coloring for a new custom theme.
    • Type: Select Graphic.
  4. You can define as many styles for the style group as required. Each style group can have one or multiple style attributes. For example, if you want to display elements in a report in four different colors, you should define four styles. If each element should have a background color, text color, and a border color you should define three style attributes for each style, one for each color type.
    1. Right-click the style group node and select Create Style.
    2. Click the new style node and change the Name and Caption attributes to help the person configuring the widget card templates to select the correct color. The name Nameis also used in queries to identify the style.
    3. Right-click the style node in the explorer and select Create Style Attribute.
    4. Click the style attribute node and set the attributes:
      • Name: Change the name to a meaningful name for display in the style selector in Alfabet Expand. The Name is also used in queries to identify the style attribute.
      • Caption: Change the caption to a meaningful caption for display in the Alfabet user interface in the views to edit the coloring for a new custom theme.
      • Default Value: Select a color from the color picker.
  5. Go to the Reports tab.
  6. Expand the Widgets node and expand the node of the widget card template you want to color.
  7. Click the node of the color variable and set the following attributes:
    • Mapping Type: Color.
    • Type: Common.
    • User Interface Item: Select the user interace style which shall be used for the text. The drop-down list includes all available styles with a text color specification with the information: style name (user interface group name).
    • Value: Leave this field empty.
  8. Assign the style group to any custom theme that shall show different coloring for the configured report.

Use the styles to color the report.

If a color for an element in a configured report is derived via a query, you can return the relevant style attribute value for the current theme as color.

Relevant database tables:

Relevant Alfabet Query Language Parameter: CUSTOM_THEME , returning the name of the custom theme currently selected for display of the Alfabet user interface.

The query to return the style attribute value is rather complex. To keep the queries in the configured reports managable, it is recommended to use a database view to store the relevant values and refer to the database view in the queries of the configured reports.

The following query returns the value of a style attribute for a defined style group, style and custom theme. It returns either the value defined for the custom theme or, if no value is defined for the custom theme, it returns the default value defined in the style.

  • SELECT CASE
  • WHEN ALFA_UI_STYLEATTRIBUTEVALUE.A_VALUE IS NULL THEN ALFA_UI_STYLEATTRIBUTE.A_VALUE
  • ELSE ALFA_UI_STYLEATTRIBUTEVALUE.A_VALUE
  • END As 'value'
  • FROM ALFA_UI_THEME
  • CROSS JOIN ALFA_UI_STYLEATTRIBUTE
  • LEFT JOIN ALFA_UI_STYLE ON ALFA_UI_STYLEATTRIBUTE.STYLE = ALFA_UI_STYLE.REFSTR
  • LEFT JOIN ALFA_UI_STYLEGROUP ON ALFA_UI_STYLE.STYLEGROUP = ALFA_UI_STYLEGROUP.REFSTR
  • FULL JOIN ALFA_UI_STYLEATTRIBUTEVALUE ON ALFA_UI_STYLEATTRIBUTE.REFSTR = ALFA_UI_STYLEATTRIBUTEVALUE.STYLEATTRIBUTE
    • AND ALFA_UI_STYLEATTRIBUTEVALUE.THEME = ALFA_UI_THEME.REFSTR
  • WHERE ALFA_UI_STYLEGROUP.NAME = 'ReportColoring'
    • AND ALFA_UI_STYLE.NAME = 'ReportStyle'
    • AND ALFA_UI_STYLEATTRIBUTE.NAME = 'BGColor'
    • AND ALFA_UI_THEME.NAME = @CURRENT_THEME