Formatting rules allow you to apply conditional formats to objects. In fact, this is how Report Writer uses conditional formats for fields in quick reports. This allows you to format negative numbers in red and positive in black, for example, or number greater than 50 in bold.

All of the formatting rules for the report are combined into a formatting rule sheet. You can access the rules a couple of ways:

  • Click the small button with a down-and-right pointing arrow just below the report's tab at the top of the Layout Area and click the "..." button beside Formatting Rules in the Report Tasks dialog that appears.

  • Click the "..." button for the Formatting Rules property of an object.

Either way, the Formatting Rules Editor appears. To add a formatting rule to an object, select the rule and click the > button. Click < to remove the selected rule from the object. Click >> to add all rules to the object or << to remove all rules. Rules are applied in the order listed; click the up or down button to move the selected rule up or down in the list.

To edit the settings for rules, click the Edit Rule Sheet button to display the Formatting Rule Sheet Editor.

To create a new rule, click the button in the tool bar. To remove the selected rule, click . Click to remove all rules or to remove rules that have been defined but not used by any object.

The properties for a rule are:

  • Name: the name of the rule. The name must start with a letter or underscore and can only contain letters, numbers, and underscores.

  • Condition: an expression that evaluates to a Boolean (true or false or yes or no) value. For literal strings, use single quotes; for example, Country='Germany'. Click the "..." button to display the Expression Editor.

  • Data Member: the name of the data table in the data set for the report. You can normally leave this blank, but if the data set contains more than one data table, choose the desired one from the list.

  • Data Source: the name of the result set for the report. You can normally leave this blank, but if there's more than one data set, choose the desired one from the list.

  • Background Color: the background color of the object.

  • Border Color: the color of the object's border. This is only applicable if at least one of the borders appears; see the Borders property.

  • Border Dash Style: the type of line used for the border: solid, dash, dot, dash-dot, dash-dot-dot, or double. This is only applicable if at least one of the borders appears; see the Borders property.

  • Border Width: the width of the border

  • Borders: which borders appear for the object. Click the down arrow to display a border picker where you can choose which borders should display.

  • Font: the font settings for the object.

  • Foreground Color: the foreground (text) color of the object.

  • Padding: the amount of space around the text as a margin. The sub-properties are All (setting this sets all the others to the same value), Bottom, Left, Right, and Top.

  • Text Alignment: the text alignment of the object. Click the down arrow to display a picker you can select the alignment from.

  • Visible: set this to No if the object should not appear when the condition is true or Yes if it should appear.

If you haven't set a property's value, it appears as "(Not set)" and it doesn't affect the property of objects using the rule. This allows you, for example, to have a rule that just sets the font of objects using the rule but not change their borders or colors.


© IQ reseller, 1996-2020 • Updated: 02/17/16
Comment or report problem with topic