Export (0) Print
Expand All
0 out of 3 rated this helpful - Rate this topic

Formatting Text

SQL Server 2000

You can set the format of a text box by updating the Format property with a formatting string. For example, you can set a text box for a number field to display the number as currency. You can use .NET formatting strings or a custom formatting string for the Format property.

Note  To apply formatting to a text box, the text box must contain an expression, for example, =Fields!LineTotal.Value or =1000. If the text box is not an expression, that is, if the text in the text box does not begin with the equal (=) sign, then the text is interpreted as a string, and formatting does not apply.

Formatting Numbers

The following table describes common .NET number formatting strings.

Format string Name
C or c Currency
D or d Decimal
E or e Scientific
F or f Fixed-point
G or g General
N or n Number
P or p Percentage
R or r Round-trip
X or x Hexadecimal

You can modify many of the format strings to include a precision specifier, for example, a formatting string of D0 formats the number so that it has no digits after the decimal point. You can also use custom formatting strings, for example, #,###.

Formatting Dates

The following table describes common .NET date formatting strings.

Format string Name
d Short date
D Long date
t Short time
T Long time
f Full date/time (short time)
F Full date/time (long time)
g General date/time (short time)
G General date/time (long time)
M or m Month day
R or r RFC1123 pattern
Y or y Year month

You can also a use custom formatting strings, for example, dd/MM/yy.

For more information about .NET formatting strings, see this Microsoft Web site.

See Also

Defining Report Appearance

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.