One of the features of Sage Report Designer is the ability to format objects in a certain way, depending on specific conditions. For example, you can choose to display all customer balances over £1000 in red.
These are the basic steps that explain how to apply conditional formatting to objects on your report. They include:
This article assumes that you have located the report or layout that you want to amend and opened it in Sage Report Designer. If you need further help with this, please refer to the following article.
There are two methods of conditional formatting that you can use.
To select the type of conditional formatting to use:
.
.The following detailed steps contain everything you need to help you to apply conditional formatting to objects on your report.
This article assumes that you have located the report or layout that you want to amend and opened it in Sage Report Designer. If you need further help with this, please refer to the following article.
There are two methods of conditional formatting that you can use.
To select the type of conditional formatting to use:
.You have now applied basic conditional formatting to objects on your report. You should make any further required changes and then save your report. For further information about saving your report, please refer to the section To save the changes to your document later in this article.
.When Advanced Conditional Formatting is selected, the Conditional Formatting window is replaced by the Expression Editor window which requires the condition to be entered as code. The code uses the following format:
if condition to be met, for example, SLCustomerAccounts.AccountBalance > SLCustomerAccounts.CreditLimit 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 (SLCustomerAccounts.AccountBalance > 1000 and SLCustomerAccounts.AccountBalance <= 5000) then
begin
TextStyle->Color := NamedColor("DarkOrange");
end
else
if SLCustomerAccounts.AccountBalance > 5000 then
begin
TextStyle->Color := NamedColor("Red");
end
The table below shows some common formatting code examples.
| To change | Syntax |
|---|---|
| Text Colour | TextStyle->Color := NamedColor("InsertColour"); |
| Bold | TextStyle->Bold := True; |
| Italic | TextStyle->Italic := True; |
| Strikeout | TextStyle->Strikeout := True; |
| Underline | TextStyle->Underline := "Double"; |
| Overline | TextStyle->Overline := "Double"; |
| Style | Formatting := FormattingStyle("Small Heading"); |
| Suppress Printing | SuppressPrinting := True; |
| Autogrow | AutoGrow := True; |
| Wordwrap | WordWrap := False; |
| Locked | Locked := True; |
| Visible | Visible := False; |
| Font | TextStyle->FontName := "Arial"; |
| Print On First Copy Only | PrintOnFirstCopyOnly := True; |
| Horizontal Alignment | TextStyle->Alignment := "Right"; |
| Vertical Alignment | TextStyle->VerticalAlignment := "Bottom"; |
You have now saved your amended document.
If you're unable to find the help you require from our online resources, log a new case with us without having to use phone or email. Simply select 'Manage your cases' from the dashboard or visit my.sage.co.uk/cases.
Did you know Sage 200 customers now have access to a range of services direct with Sage. These include a bespoke Report Design Service, a library of How to Webinars and Ideas Portal just to name a few. Explore your potential using Sage 200 Services.