Format masks objects are assigned to date and numeric fields and are used to define how data returned for that field is displayed. Date fields are required to have format masks.
Format masks have the following rules:
Must be created before assigning to date/numeric type fields.
Are case-sensitive. For instance, if you enter M, you indicate Month, and if you enter m you indicate minutes.
Cannot be modified once created, only deleted.
Cannot be deleted if assigned to fields.
Xephr expects dates returned from the datasource to be in the format defined in the datasource. The format mask is then applied to the date returned from the datasource.
In the Explorer Tree, select the Format Mask Information object.
There are options in creating a report template at this point.
Right-click on the Template Information object, and left click on the New Format Mask option.
Left-click on the [Format Mask] button in the Main Toolbar.
Left-click on the File Menu. Left-click on the New option. Left-click on the Format Mask option.
Press Alt+A on the keyboard.
The Creating Format Mask screen is displayed.
In the Format Mask property, enter the format mask that you are creating, using the rules described in the Format Mask Structure section.
In the Data Type property, select
the data type to which this format mask will be applied. Choices
are:
Numeric
Date (Only)
Date and Time
Click on the Create button to create the format mask.
Click on the [Save] button in the main toolbar to save the new format mask. Format masks cannot be modified once they have been created.
Symbol |
Meaning |
Presentation |
Example |
G |
Era Designator |
Text |
AD |
y |
Year |
Number |
1996 |
M |
Month in Year |
Text & Number |
July & 07 |
d |
Day in Month |
Number |
10 |
h |
Hour in AM/PM (1-12) |
Number |
12 |
H |
Hour in Day (0-23) |
Number |
0 |
m |
Minute in Hour |
Number |
30 |
s |
Second in Minute |
Number |
55 |
S |
Millisecond |
Number |
978 |
E |
Day in Week |
Text |
Tuesday |
D |
Day in Year |
Number |
189 |
F |
Day of Week in Month |
Number |
2 (2nd Wed in July) |
w |
Week in Year |
Number |
27 |
W |
Week in Month |
Number |
2 |
a |
AM/PM Marker |
Text |
PM |
k |
Hour in Day (1-24) |
Number |
24 |
K |
Hour in AM/PM (0-11) |
Number |
0 |
x |
Time Zone |
Text |
Pacific Standard Time |
' |
Escape for Text |
Delimiter |
|
" |
Single Quote |
Literal |
' |
The count of pattern letters determine the format.
For Text types, if there are four or more pattern letters, use the full form. If there are less than four pattern letters, use the short or abbreviated form.
For Number types, the minimum number of digits should be entered. If a number is entered that is less than this number of digits, they will be padded with zeros to this amount. For y (Year), if the count of 'y' is 2, the Year will be truncated to 2 digits.
For Text & Number types, if there are three or more pattern letters, use text. If less than three pattern letters are entered, us the number.
Examples:
Format Pattern |
Result |
yyyy.MM.dd G 'at' hh:mm:ss z |
1996.07.10 AD at 15:08:56 PDT |
EEE, MMM d, ''yy |
Wed, July 10, '96 |
h:mm a |
12:08 PM |
hh 'o''clock' a, zzzz |
12 o'clock PM, Pacific Daylight Time |
K:mm a, z |
0:00 PM, PST |
yyyyy.MMMMM.dd GGG hh:mm aaa |
1996.July.10 AD 12:08 PM |
Number format masks can contain a positive and negative mask, separated by a semi-colon. Zeros and # represent digits that must be present. Commas add thousand separators, while decimals show where the decimal goes. In the following example, negative values will be displayed surrounded by parentheses.
For example: #,##0.00;(#,##0.00). #,##0.00 is the positive display. (#,##0.00) is the negative display.
Percentage signs are handled slightly different than other punctuation marks in format masks. Adding a percent sign in a format mask indicates that you want the value multiplied by 100 and shown as a percentage. So, if the value in your field is .85 and the format mask ###.##% is applied to the field, the value will be displayed as 85%.
If you want the percent symbol displayed without the percentage formatting applied, then the percent sign needs to be escaped in the format mask using single quotes: ###.##'%'
Spreadsheets have a special set of format masks that are understood.
The following format masks are good examples, but
they can be expanded some (such as to more decimal places).
Date format masks are the same as those described in the Date Format masks
section.
Format Pattern |
Result |
General |
Formats exactly as it is in the datasource. |
0 |
Rounds to the nearest whole number. |
0.00 |
Formats with two decimal points, rounds to the nearest hundredth. |
#,##0 |
Rounds to nearest whole number. Formats thousands
with a comma. |
#,##0.00 |
Formats with two decimal points, rounds to the nearest hundredth. Formats
thousands with a comma. |
($#,##0_);($#,##0) |
Rounds to nearest whole number. Formats thousands
with a comma. Negative numbers are placed in parentheses.
The dollar sign ($) is placed before the value. |
($#,##0_);[Red]($#,##0) |
Rounds to nearest whole number. Formats thousands
with a comma. Negative numbers are placed in parentheses
and colored red. The dollar sign ($) is placed
before the value. |
($#,##0.00_);($#,##0.00) |
Formats with two decimal points, rounds to the nearest hundredth. Negative
numbers are placed in parentheses. The dollar sign
($) is placed before the value. |
($#,##0.00_);[Red]($#,##0.00) |
Formats with two decimal points, rounds to the nearest hundredth. Negative
numbers are placed in parentheses and colored red. The
dollar sign ($) is placed before the value. |
0% |
Converts the value to a percentage by multiplying it by 100. Rounds
the result to the nearest whole number and adds a percentage sign (%)
to the end. |
0.00% |
Converts the value to a percentage by multiplying it by 100. Rounds
the result to the nearest hundredth and adds a percentage sign (%) to
the end. |
0.00E+00 |
Formatted using scientific notation, with 2 digits in the exponent.
A plus sign signifies a positive exponent while
a minus sign signifies a negative exponent. |
# ?/? |
Converts value to a whole number and its fractional single digit remainder. |
# ??/?? |
Converts value to a whole number and its fractional double digit remainder. |
Xephr is a registered trademark of NDS Systems, LC.
Copyright