Trouble viewing images? Click on images to enlarge.
In this article we cover using format strings inside the Finished Reports expression editor. This will allow users to format dates, strings, etc. through the use of an expression.
Please read the important note below.
Important Note:
It is very important to note that this method should not / does not replace using the format strings set on the label. When a format string is applied at the expression level, this will change the actual value of the data vs masking how it is displayed.
For example. if there was a date value of 1/1/2021 12:00 PM and a format string is used at / on the label to make it appear as January 1, 2021, the value would still be 1/1/2021 12:00 PM.
When the format string is applied at the expression level, the actual value of the data is being changed. This means the date value of 1/1/2021 12:00 PM is now actually February 1, 2021.
Example Format Strings
FormatString('{0:MMMM dd, yyyy}',Today()): February 18, 2021
FormatString('{0:yyyy-MM-dd}',Today()): 2021-02-18
FormatString('{0:(000) 000 - 0000}', ToLong([Phone Number])): (219) 689 - 6964
Video Tutorial:
Not yet available.
How To Use Format Strings In The Expression Editor
1. Open/Create your View and run it. Then go into the Finished Reports Designer.
2. Place a label into the Finished Report and go into the expression editor.
3. Create your expression and add the format string
4. Preview the results. The top label uses the format string on the Today() function. The label below is the same function, without the format string.
Results:
Format String: February 18, 2021
No Format String: 02/18/2021 00:00:00
Additional Examples:
FormatString('{0:MM/dd/yyyy}',[Date_Listed])
FormatString('{0:c2}',[Account_Balance]))
Comments
0 comments
Please sign in to leave a comment.