Add a Legend to a Page Section

This material pertains to version 3.0 of Blackbaud CRM SDK.

Add a Legend for a List Builder

The StandardView element allow allows for a Legend element, which is a feature borrowed from the page section used to display a data list. Within the Legend element, the LegendExpressionList element is used to provide a series of LegendExpression elements. In this way, you can add multiple expressions that evaluate to either True or False. The ForeColor, Bold, Italics, and DisplayStyle attribute values are applied to each row which meet the expression criteria.

Please note the ForeColor, Bold, Italics, and DisplayStyle attribute values are only applied to each row where the expression criteria is met AND the columns referenced within the expression are visible within the list builder. This means you could have a row or rows within the list builder which meet the criteria and the styling would not be applied to the row if all the columns referenced within the expression are not visible within the list builder.

In the example below,each row where the LINEAMOUNT (Tx Detail Line Amt) column is greater than $10.00 causes the relevant text within the row to be displayed in bold font with green letters. Colors for action links (example: Food Bank column) are not affected by the legend color.

When adding an expression within the XML of PageDefinitionSpec, be sure to use the appropriate escape characters for quotes, apostrophes, greater than, less than, and ampersand. See the table below:

Character Escape Character
" "
' '
< &lt;
> &gt;
& &amp;

Figure: Legends allow you to provide basic formatting to individual rows that meet expression criteria.

Figure: Add a legend to the list builder section within a PageDefinitionSpec. Note the escape character for Greater Than (>).

Configure a Legend within a Page Section

With Page Designer functionality fully implemented in version 3.0, an administrator can configure a legend for a list builder. With design mode toggled on, the administrator can edit the page section's properties by specifying the appropriate Legend property values. Assuming a list builder section exists within a page, select the ellipsis button to the right of the Legend property:

Figure: Edit a page section

The Legend property sheet will appear. From here you can add additional legends or edit an existing legend. Below is a screen shot of an existing Legend property. The administrator can build a Boolean (true/false) expression. which is evaluated for each row in the list. If the expression evaluates to True the legend's properties will be applied to the row.

Figure: Edit an existing legend

The Bold property indicates whether or not the text of the row is bold. The Italics property indicates whether or not the text of the row is in italics. The ForeColor property sets the text color.

For the ForeColor property, use standard HTML color names such as Green, Maroon, Indigo, CornflowerBlue, etc. instead of the value provided by the color picker. This is a known issue and will be resolved in the future.

The DisplayStyle specifies a pre-defined style for the row. The table below describes each of the options and their effect:

Display Style Description
None Indicates that no display style is specified for the legend expression.
Primary Indicates that the row should be displayed as the primary or most important row in the list. The default implementation for this display style is bold.
Good Indicates that the row should be displayed as "good." The default implementation for this display style is green text.
Warning Indicates that the row should be displayed as a warning. The default implementation for this display style is amber text.
Bad Indicates that the row should be displayed as "bad." The default implementation for this display style is red text.
Inactive Indicates that the row should be displayed as inactive. The default implementation for this display style is italics.