Crystal Reports  

Date Tab (Custom Styles)

Use the Date tab to set detailed formatting options for date fields in your report.

Date type
The Regional Settings dialog box in the Windows Control Panel allows you to specify default date formats for use with any Windows program. You can specify the month/day/year separator and the order in which the date elements appear. These dialog boxes also allow you to specify a short date style (like 12/24/96 or 16 Mar, 1996) and a long date style (like Sunday, April 21, 1996).

This list lets you:

  • choose one of the two default styles
  • choose Custom to create your own style in the Format Editor.

Select the option that fits your needs. The program modifies the sample date at the bottom of the dialog box to demonstrate the style you have chosen.

Calendar type
Your operating system may support more than one calendar type.

Format

Month
If you want to create a custom format for a date field object, use this list to specify the way you want the program to print/display the month part of the date. Your options are:
3 Prints a month as a number. If the month number is only a single digit, it prints the number without a leading zero.
03 Prints the month as a number. If the month number is only a single digit, it prints the number with a leading zero.
Mar Prints a three letter abbreviation for the month.
March spells out the full name of the month.

The program modifies the sample date at the bottom of the dialog box to reflect your choice.

Day
If you want to create a custom format for a date field object, use this list to specify the way you want the program to print/display the day part of the date. Your options are:
1 Prints the day as a number. If the day number is only a single digit, it prints the number without a leading zero.
01 Prints the day as a number. If the day number is only a single digit, it prints the number with a leading zero.

The program modifies the sample date at the bottom of the dialog box to reflect your choice.

Year
If you want to create a custom format for a date field object, use this list to specify the way you want the program to print/display the year part of the date.
99 Prints the year in its short, two digit format.
1999 Prints the year in its long, four digit format.

The program modifies the sample date at the bottom of the dialog box to reflect your choice.

Era/Period Type
Use the Era/Period Type list to select either a short or long era/period of time.

Order

YMD, DMY, MDY options
If you want to create a custom format for a date field object, use these options to select the order in which you want the elements of the date to appear. Your options are:
MDY Prints the date in the order Month, Day, Year.
DMY Prints the date in the order Day, Month, Year.
YMD Prints the date in the order Year, Month, Day.

The program modifies the sample date at the bottom of the dialog box to demonstrate the sequence you have chosen.

Day of Week

Type
When you are setting up a custom format for a date field object, if you want the name of the day (or an abbreviation of that name) to appear before the rest of the date, use this option to set the format for that name. Your options are:
Short Prints an abbreviation of the day name before the date (for example, Fri).
Long Prints the full day name before the date (for example, Friday).
None Does not print a day name before the date.

The program modifies the sample date at the bottom of the dialog box to reflect your choice.

If you set this property to Short or Long, you need to specify the character(s) you want to use to separate the name from the date itself. You do that in the Separator box.

Sep
When you are setting up a custom format for a date field object, , you need to specify the character(s) you want to use to separate the day of the week from the date itself. You do that in this box. Within practical limits, you can use as many characters as you need.

Type in the characters you want to use. The program modifies the sample date at the bottom of the dialog box as you do.

Encl
Use the Enclosures list to select parentheses or square brackets as an enclosure for date/time fields on your report.
Position
Use the Position list to select either a Leading or a Trailing position.

Separators

When you are setting up a custom format for a date field object, the program enables you to specify the separators, if any, that you want to use to separate the date elements. Since each date has three elements (YMD, DMY, or MDY), you can specify two different separators. The first separator goes between the first and second elements, the second separator goes between the second and third elements.

Prefix
Use the Prefix box to create a prefix for dates in your date field, for example, DATE.
First
When you are setting up a custom format for a date field object, the program enables you to specify the separators, if any, that you want to use to separate the date elements. Since each date has three elements (YMD, DMY, or MDY), you can specify two different separators. The first separator goes between the first and second elements, the second separator goes between the second and third elements. Type the character(s) you want to use for the first separator in this box. Within practical limits, you can use as many characters as you need. For example,
  • if you are using a short format, all numbers, you may want to specify a forward slash (/) as the first separator and as the second separator as well (like 12/25/96)
  • if you are using a long format with the month spelled out, you may not want to use any separator between the first and second elements and then use a comma between the second and third (like March 22, 1998).
Second
When you are setting up a custom format for a date field object, the program enables you to specify the separators, if any, that you want to use to separate the date elements. Since each date has three elements (YMD, DMY, or MDY), you can specify two different separators. The first separator goes between the first and second elements, the second separator goes between the second and third elements. Type the character(s) you want to use for the second separator in this box. Within practical limits, you can use as many characters as you need. For example,
  • if you are using a short format, all numbers, you may want to specify a forward slash (/) as both the first and second separators (for example, 12/25/96)
  • if you are using a long format with the month spelled out, you may not want to use any separator between the first and second elements and then use a comma between the second and third (like March 22, 1998).
Suffix
Use the Suffix box to create a suffix that follows the dates in your date field.

See Also

Format Editor | Formatting Data | Formula Editor