This article explains how to format the date Date and time Time fields in a NetAnalysis® report.
|Table of Contents|
Formatting Date and Time Fields
In this tutorial, we will create a new report and format the output of for a Date/Time field.
When creating or editing reports, use a small number of records to make it easier to preview the results.
The Field List is docked to the top, right-hand side (outlined in red on the image above).
4. Select a Date and Time field from the Field List and drag it onto the Detail section on the report.
Date and Time Formatting
Field properties can also be changed by selecting the item and accessing the properties from the docked panel on the bottom, right-left hand side of the Report Designer.
When the smart tag is clicked, you will see the Label Tasks window. One of the options is Format String. The text value for this property will control how the date time value is displayed in the report.
In the example above, the zero represents a place holder for the date time value, and the lowercase "d" character represents the Standard date and time format string for the Short date pattern, as set in the options for Microsoft Windows date pattern formats.
5. Click on the Format String's property ellipsis button Format String Editor.and launch the
The Format String Editor has a collection of Standard Types and Custom Types. Make sure, DateTime is selected for the Category. You can select from any of the options shownlisted, or add your own.
How to use the General Settings Date Format
To do this, we will make use of the Parameter Fields found underneath the Field List in the Report Designer. There are a number of parameters available for use in your report. See the list in the image below.
The parameter we are going to use is DateTimeFormatString in conjunction with , and we will set that by using the Expression Editor, which can also be accessed from the Field's smart tag.
When you first open the Label Tasks window (after clicking the smart tag), the Expression property will contain the name of the field surrounded by square brackets. As we also use square brackets in our field name, the closing square bracket has an escape character immediately before it.