Trouble Viewing Images? Right-click on any image and select "Open in new tab" to view a larger version. You can also zoom in using Ctrl + Mouse Wheel for easier readability.
Article Goal
Explain how to use format strings inside the Expression Editor in Finished Reports and clarify when this method should and should not be used.
Expression-Level Format Strings
What: Expression-level format strings allow you to format dates, numbers, and strings directly within an expression using the FormatString() function.
Why: This provides advanced control when formatting must be applied dynamically or combined with other expression logic.
Configuration Note
| Item | Details |
|---|---|
| Expression vs Label formatting | Format strings applied in expressions change the underlying value, not just its display. |
| Recommended usage | Use expression-level formatting only when label-level formatting cannot meet the requirement. |
| Impact on data | Once formatted in an expression, the value is no longer treated as its original data type. |
Important Note (Read Carefully)
Expression-level format strings do not replace format strings applied directly on labels.
When a format string is applied on a label, it only affects how the value is displayed. The underlying data remains unchanged.
For example, if a date value is:
1/1/2026 12:00 PM
And the label format displays it as:
January 1, 2026
The actual value is still:
1/1/2026 12:00 PM
When a format string is applied inside an expression, the actual value is changed.
This means the same date value may now become a formatted string, such as:
February 1, 2021
Once changed at the expression level, the value can no longer be treated as a true DateTime value.
Use Case
| Scenario | Description |
|---|---|
| Advanced formatting logic | Apply formatting that must be combined with expressions or conditional logic. |
| Output-only values | Format values intended only for display, not further calculation or grouping. |
| Custom string output | Generate formatted strings that cannot be achieved through label formatting alone. |
Example Format Strings
Below are common examples of using FormatString() in expressions:
Long date format
FormatString('{0:MMMM dd, yyyy}', Today())
Result:January 22, 2026ISO date format
FormatString('{0:yyyy-MM-dd}', Today())
Result:2026-01-22Phone number formatting
FormatString('{0:(000) 000 - 0000}', ToLong([Phone Number]))
Result:(219) 689 - 6964
Steps to Use Format Strings in the Expression Editor
Step 1: Open the Finished Reports Designer
Open or create your View, run it, then open the Finished Reports Designer.
Step 2: Add a Label and Open the Expression Editor
Place a Label into the report, then open the Expression Editor for that label.
Step 3: Create the Expression with a Format String
Build your expression using the FormatString() function.
Step 4: Preview the Results
Preview the report to compare formatted and unformatted values.
In this example:
The top label uses a format string on
Today()The label below uses
Today()without formatting
Results:
Format String:
January 22, 2026No Format String:
01/22/2026 00:00:00
Additional Examples
FormatString('{0:MM/dd/yyyy}', [Date_Listed])FormatString('{0:c2}', [Account_Balance])
Article Summary
This article explains how to use format strings within the Finished Reports Expression Editor and highlights the critical difference between expression-level formatting and label-level formatting. While expression-based format strings offer flexibility and advanced control, they also change the underlying value of the data. For most scenarios, label formatting is preferred, with expression-level formatting reserved for cases where formatting must be applied as part of the expression logic itself.
Comments
0 comments
Please sign in to leave a comment.