ActiveReports allows you to set formatting strings for date, time, currency, and other numeric values using the OutputFormat property on the textbox control. The OutputFormat dialog also allows you to select international currency values and select from various built-in string expressions. In addition to the built-in string expressions, you may use any .NET standard formatting strings. You can find information about these strings (Numerics and Date/Time formats) on MSDN.
The OutputFormat property of the TextBox control includes four sections delimited by a semicolon. Each section contains the format specifications for a different type of number:
- The first section provides the format for positive numbers.
- The second section provides the format for negative numbers.
- The third section provides the format for Zero values.
- The fourth section provides the format for Null or System.DBNull values.
Times:
- hh:mm tt = 09:00 AM
- HH:mm = 21:00 (twenty-four hour clock)
- HH = hours in 24 hour clock
- hh = hours in 12 hour clock
- mm = minutes
- ss = seconds
- tt = AM or PM
Dates:
dddd, MMMM d, yyyy = Saturday, December 25, 2004
dd/MM/yyyy = 25/12/2004
d or dd = day in number format
ddd = day in short string format (i.e. Sat for Saturday)
dddd = day in string format (i.e. Saturday)
MM = month in number format
MMM = month in short string format (i.e. Dec for December)
MMMM = month in string format (i.e. December)
y or yy = year in two digit format (i.e. 04 for 2004)
yyyy or yyyy = year in four digit format (i.e. 2004)
Currency and numbers:
$0.00 = $6.25
$#,#00.00 = $06.25
0 = digit or zero
# = digit or nothing
% = percent-multiplies the string expression by 100
Visual Basic Language Reference: Format function
Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.