Databases Reference
In-Depth Information
Standard Formatting
Standard, one-character strings may be used to specify formatting options for numbers and dates. One
advantage of using standard format strings is that culture-specific formats are automatically applied.
Depending on the application of the report, this could also be undesirable. For example, if a user whose
local computer was configured for a European regional locale were to view an invoice, he or she might
think they were buying a bike for a thousand Euros instead of a thousand U.S. dollars. In such as case, it
might be best to explicitly format the currency as U.S. dollars and then use a general format for dates, so
they appear to the European user in their native format. The best way to do this is to use standard format-
ting strings for both the currency and date text boxes and then set the Locale property for the currency to
the EN-US locale. Leaving this property blank for the date will cause it to be resolved when the report is
rendered based on the client settings.
There is plenty of information on this subject in Reporting Services Books Online. Unfortunately, there is
also a lot of extra information that just doesn't apply to most reporting needs. The objective is to keep
this simple and show you only what you really need to know for the majority of reports. The following
table lists the common format strings that apply to numeric data types.
Format
Description
Example
C
Currency
$123,456,78.9.12
D
Decimal
123456789
followed by optional precision specifier
000123456789 using D12
E
Scientific notation
1.234568e+008
followed by optional precision specifier
1.234567891234+008 using E12
F
Fixed-point
123456789.12
followed by optional precision specifier
123456789.123400000000 using F12
P
Percent
12.35%
followed by optional precision specifier
The next table lists the common format strings that apply to date and time data types.
Format
Description
Example
d
Short date
11/1/03
D
Long date
Saturday, November 01, 2003
t
Short time
3:34 PM
T
Long time
3:23:26 PM
f
Full date and time
Saturday, November 01, 2003 3:34 PM
F
Full date and time
Saturday, November 01, 2003 3:34:26 PM
g
General date and time
11/1/03 3:34 PM
Search WWH ::




Custom Search