Format strings can be used inside the Finished Reports Expression Editor to control how dates, numbers, and other values are displayed as part of an expression.
This is useful when formatting needs to be combined with expression logic or when label-level formatting does not provide enough control.
Expression-Level Format Strings
Finished Reports supports the FormatString() function for formatting values directly inside an expression.
For example:
FormatString('{0:MMMM dd, yyyy}', Today())
This produces a formatted text result such as:
January 22, 2026
Expression-level formatting is useful when the formatted value is part of a larger expression or when the output needs to be constructed dynamically.
Expression Formatting vs. Label Formatting
There is an important difference between formatting a value with FormatString() and applying a format directly to a Label.
Label Formatting
When formatting is applied directly to a Label, only the displayed value changes.
For example, a DateTime value may contain:
01/22/2026 00:00:00
A Label format can display the same value as:
January 22, 2026
The value remains a DateTime value even though its appearance has changed.
Expression Formatting
When FormatString() is used inside an expression, the expression returns formatted text.
For example:
FormatString('{0:MMMM dd, yyyy}', Today())
returns:
January 22, 2026
Because the expression result is formatted text, it should not be treated the same as the original DateTime or numeric value for later calculations, grouping, sorting, or other operations that depend on the original data type.
Note: Use Label formatting when you only need to change how a value is displayed. Use
FormatString()when formatting needs to be part of the expression itself.
When to Use Expression-Level Formatting
Expression-level formatting can be useful for:
- Combining formatted values with other expression logic
- Creating custom text output
- Formatting values that are intended primarily for display
- Producing output that cannot be created using Label formatting alone
For most standard date, number, currency, or percentage formatting, applying the format directly to the Label is usually simpler.
Example Format Strings
Long Date
Expression:
FormatString('{0:MMMM dd, yyyy}', Today())
Example result:
January 22, 2026
ISO Date
Expression:
FormatString('{0:yyyy-MM-dd}', Today())
Example result:
2026-01-22
Phone Number
Expression:
FormatString('{0:(000) 000 - 0000}', ToLong([Phone Number]))
Example result:
(219) 689 - 6964
Step 1: Open the Finished Reports Designer
Open or create the View, run it, and open the Finished Reports Designer.
Step 2: Add a Label and Open the Expression Editor
Add a Label to the report.
Select the Label and open its Expression Editor.
Step 3: Create the Expression
Build the expression using the FormatString() function.
For example:
FormatString('{0:MMMM dd, yyyy}', Today())
Step 4: Preview the Results
Select Preview and compare the formatted and unformatted values.
In the current example:
- The first Label uses
FormatString()withToday() - The second Label uses
Today()without formatting
Example results:
Format String
January 22, 2026
No Format String
01/22/2026 00:00:00
Step 5: Save the Report
After confirming the formatted output, save the Finished Report.
Additional Examples
Date
FormatString('{0:MM/dd/yyyy}', [Date_Listed])
Currency
FormatString('{0:c2}', [Account_Balance])
Comments
0 comments
Please sign in to leave a comment.