Within Sage Report Designer you can create filters and expressions.
You can create various types of filter, including report, section and conditional filters. For further information about creating these filter types, please refer to the following articles:
Report Designer - To create or edit filters
Report Designer - How to apply conditional formatting to a variable
Report Designer - How to use operators
SLPostedCustomerTrans.OutstandingValue <> 0
or
PLPostedSupplierTrans.OutstandingValue <> 0
SLCustomerAccounts.AccountBalance <> 0
or
PLSupplierAccounts.AccountBalance <> 0
SLCustomerAccounts.AccountBalance <> SLCustomerAccounts.CreditLimit
or
PLSupplierAccounts.AccountBalance <> PLSupplierAccounts.CreditLimit
SLPostedCustomerTrans.NetValue > 100
or
PLPostedSupplierTrans.NetValue > 100
The terms agreed is a flag with 0 meaning the terms are not agreed and 1 meaning they have been.
SLCustomerAccounts.TermsAgreed = 1
or
PLSupplierAccounts.TermsAgreed = 1
In this example the text always starts with ABC, however it would work for any other text. The percentage sign allows the reference to contain any text after the ABC
NLPostedNominalTrans.Reference like "ABC%"
You can use 1 of 2 available fields to achieve this. The active flag or the active text
StockItems.StockItemStatusID=1
or
StockItems.Status like "Inactive"
(SOPOrderReturnLines.LineQuantity - SOPOrderReturnLines.DespatchReceiptQuantity) <> 0
This will only be correct if the full amount is outstanding
SLPostedCustomerTrans.OutstandingValue - ((SLPostedCustomerTrans.OutstandingValue * SLPostedCustomerTrans.BaseNetValue) / SLPostedCustomerTrans.BaseGrossValue)
In this example the commission is calculated at 10%.
SLPostedCustomerTrans.BaseNetValue* 0.10
To show the first name from the Customer contact name:
Substring(SLCustomerAccounts.ContactName,0,IndexOf(SLCustomerAccounts.ContactName," "))
To show the surname from the Customer contact name:
Substring(SLCustomerAccounts.ContactName,IndexOf(SLCustomerAccounts.ContactName," "),
(Length(SLCustomerAccounts.ContactName)-IndexOf(SLCustomerAccounts.ContactName," ")))
To show the first name from the Customer contact name and add a comma:
Concat(Substring(SLCustomerAccounts.ContactName,0,IndexOf(SLCustomerAccounts.ContactName," ")) ,",")
The Concat( ) function is used to combine the first name of the contact name with a comma. The Substring( ) function is used to extract the first name from the SLCustomerAccounts.ContactName. The IndexOf( ) function is used to make the Substring function return all information before the first space in the contact name.
To change the Customer contact name to initial capitals, regardless of whether it was entered in all capitals or all lower case:
ToUpper(Substring(SLCustomerAccounts.ContactName, 0,1)) + ToLower(Substring(SLCustomerAccounts.ContactName, 1, (IndexOf(SLCustomerAccounts.ContactName, " ")))) + ToUpper(Substring(SLCustomerAccounts.ContactName, (IndexOf(SLCustomerAccounts.ContactName," " )+1),1)) + ToLower(Substring(SLCustomerAccounts.ContactName, (IndexOf(SLCustomerAccounts.ContactName, " ")+2)))
Substring(SLCustomerAccounts.AnalysisCode1,Length(SLCustomerAccounts.AnalysisCode1) - 3)
This calculates the length of the string, in this example the analysis 1 value, and then instructs the substring to start 3 digits from the end, that is, the length minus 3.
SOPInvoiceCredits.DocumentDate + Days(30)
SOPInvoiceCredits.DocumentDate + SLCustomerAccounts.PaymentTermsInDays
Profit / Cost * 100
Profit / Sales * 100
In the email settings of a document, to show a numeric value in the email subject you can use the CString() function, however this removes zeros after the decimal place, for example, 100.00 appears as 100 and 100.20 appears as 100.2. If required, you can use an if statement expression to show the zeros. This example uses the sales ledger balance but you can use different amount variables as required.
FormatString ("{0:N2}",SLCustomerAccounts.AccountBalance)
FormatString ("{0:P2}", Value1/Value2))
This example uses the gross amount but you can use different amount variables as required.
FormatString("{0},{1:N2}", (SYSCurrencies.Symbol!="" ? SYSCurrencies.Symbol : SYSCurrencies.Symbol + " "), SLPostedCustomerTrans.BaseGrossValue)
This example uses the gross amount but you can use different amount variables as required.
Replace( FormatString("{0:f2}", SLPostedCustomerTrans.GoodsValueInAccountCurrency), "." , "," )
The FormatString specifier 'f2' gives a string fixed to two decimal places. You can change this if required. The above expression only works if it's set to Signed. To show the values as Unsigned, Debit or Credit, you must include this in the expression, but leave the Properties set to Signed, for example:
You can use expressions to change the date formats used on your reports or to calculate other dates or values based on a date. Below are some examples:
For example, to show the end of the month that a transaction is dated in.
CreateDateTime(YearFromDate(SLPostedCustomerTrans.TransactionDate),
MonthFromDate(SLPostedCustomerTrans.TransactionDate),
DaysInMonth(YearFromDate(SLPostedCustomerTrans.TransactionDate),
MonthFromDate(SLPostedCustomerTrans.TransactionDate)))
For example, if the transaction date is 12/11/12, the expression shows 30/11/12.
For example, an invoice due date may be the end of the month following the invoice date. To show this:
MonthFromDate(SLPostedCustomerTrans.TransactionDate) < 12 ?
CreateDateTime( YearFromDate(SLPostedCustomerTrans.TransactionDate),
MonthFromDate(SLPostedCustomerTrans.TransactionDate)+1,
DaysInMonth (YearFromDate(SLPostedCustomerTrans.TransactionDate), MonthFromDate(SLPostedCustomerTrans.TransactionDate) +1) ) :
CreateDateTime(YearFromDate(SLPostedCustomerTrans.TransactionDate)+1, 1, 31)
For example, if the invoice date is 12/11/12, the expression shows 31/12/12.
SLPostedCustomerTrans.TransactionDate +
((DaysInMonth(YearFromDate(SLPostedCustomerTrans.TransactionDate),
MonthFromDate(SLPostedCustomerTrans.TransactionDate)))) -
(StringToInteger(DateTimeToFormattedString(SLPostedCustomerTrans.TransactionDate, "dd"))) +1
For example, an invoice due date may be the 20th of the month following the invoice date. The following expression shows this due date:
CreateDateTime(YearFromDate(SLPostedCustomerTrans.TransactionDate),
MonthFromDate(SLPostedCustomerTrans.TransactionDate),
DaysInMonth(YearFromDate(SLPostedCustomerTrans.TransactionDate),
MonthFromDate(SLPostedCustomerTrans.TransactionDate))) + 20
For example, if the invoice date is 12/11/12, the expression shows 20/12/12.