Report Designer - Advanced conditional formatting

Summary

In Sage Accounts Report Designer you can format objects based on specific conditions, this is known as conditional formatting. For example, you may want to display all customer balances over £1000 in red.

Description

With basic conditional formatting, you can create a filter and set a format that applies when that filter is met. However, if you want to apply conditions that are more complex or multiple conditions, you can use the advanced conditional formatting option instead.

As an alternative to conditional formatting, you can also use If statement expressions.

Resolution

Before following the steps below you must open your document in Sage Report Designer.

Set the format method to advanced
  1. In Report Designer, on the menu bar click Tools then click Options.
  2. Ensure the Use Advanced Conditional Formatting check box is clear, then click OK.
Apply advanced formatting

If you can't see the Properties pane mentioned below, on the menu bar click View then click Properties pane. If the pane doesn't appear, you can reset the Report Designer view to its default.

  1. In Report Designer, click the data field or variable you want format.
  2. In the Properties pane, click Conditional Formatting then click the finder button

    Image

    .
  3. In Expression Editor, enter your conditional formatting expression, then click OK.

For information about the syntax used in advanced conditional formatting, please refer to the following section.

Advanced formatting syntax guide

When the Use Advanced Conditional Formatting option is selected, the Conditional Formatting window is replaced by the Expression Editor window. This requires the condition to be entered as an expression in the following format:

if   condition to be met, for example, SALES_LEDGER.BALANCE > SALES_LEDGER.CREDIT_LIMIT then

begin
            the formatting to apply, for example, TextStyle->Color := NamedColor("Red");
end

You can create multiple conditions by using an else statement to separate each individual condition, for example:

if  (SALES_LEDGER.BALANCE > 1000 and SALES_LEDGER.BALANCE <= 5000) then

begin
            TextStyle->Color := NamedColor("DarkOrange");
end

else

if  SALES_LEDGER.BALANCE > 5000 then

begin
            TextStyle->Color := NamedColor("Red");
end

The table below shows some common formatting code examples.

To changeSyntax
Text ColourTextStyle->Color := NamedColor("InsertColour");
BoldTextStyle->Bold := True;
ItalicTextStyle->Italic := True;
StrikeoutTextStyle->Strikeout := True;
UnderlineTextStyle->Underline := "Double";
OverlineTextStyle->Overline := "Double";
StyleFormatting := FormattingStyle("Small Heading");
Suppress PrintingSuppressPrinting := True;
AutogrowAutoGrow := True;
WordwrapWordWrap := False;
LockedLocked := True;
VisibleVisible := False;
FontTextStyle->FontName := "Arial";
Print On First Copy OnlyPrintOnFirstCopyOnly := True;
Horizontal AlignmentTextStyle->Alignment := "Right";
Vertical AlignmentTextStyle->VerticalAlignment := "Bottom";

Once you've added your conditional formatting you should save the changes to your document.

Upgrade your licence

Growing business? Add more companies, users, or employees to your licence with ease. Leave your details and we’ll be in touch.

Image


Solution Properties

Solution ID
200427112418157
Last Modified Date
Thu Jul 28 12:49:54 UTC 2022
Attributes
Product Details
Modules: Report Writer
Views
0