Class RepDateTime
Represents a date-time object in a PDF report, where the dimensions are in points.
public class RepDateTime : RepString
- Inheritance
-
RepDateTime
- Derived
- Inherited Members
Examples
StandardFontDef fontDef = new(StandardFont.Helvetica);
FontProp font = new(fontDef, 10);
DateTime dt = new(2024, 8, 7, 6, 54, 32);
RepDateTime rdt = new(_font, dt, "G", CultureInfo.InvariantCulture);
Result: 08/07/2024 06:54:32
Constructors
RepDateTime(FontProp, DateTime, string, double, CultureInfo?)
Initializes a new instance of the RepDateTime class with the specified font, date-time, format, maximum width and culture information.
public RepDateTime(FontProp font, DateTime dateTime, string format, double widthMax, CultureInfo? cultureInfo = null)
Parameters
font
FontPropThe font for the date-time text.
dateTime
DateTimeThe date-time value.
format
stringThe format string used to format the date-time value.
widthMax
doubleThe maximum width of the date-time string in points.
cultureInfo
CultureInfoThe culture information used to format the date-time value. The default value is null which takes the current culture.
Exceptions
- ArgumentNullException
The font or the format is null.
RepDateTime(FontProp, DateTime, string, CultureInfo?)
Initializes a new instance of the RepDateTime class with the specified font, date-time, format and culture information.
public RepDateTime(FontProp font, DateTime dateTime, string format, CultureInfo? cultureInfo = null)
Parameters
font
FontPropThe font for the date-time text.
dateTime
DateTimeThe date-time value.
format
stringThe format string used to format the date-time value.
cultureInfo
CultureInfoThe culture information used to format the date-time value. The default value is null which takes the current culture.
Exceptions
- ArgumentNullException
The font or the format is null.
RepDateTime(FontProp, DateTime?, string, double, CultureInfo?)
Initializes a new instance of the RepDateTime class with the specified font, nullable date-time, format, maximum width and culture information.
public RepDateTime(FontProp font, DateTime? dateTime, string format, double widthMax, CultureInfo? cultureInfo = null)
Parameters
font
FontPropThe font for the date-time text.
dateTime
DateTime?The nullable date-time value.
format
stringThe format string used to format the date-time value.
widthMax
doubleThe maximum width of the date-time string in points.
cultureInfo
CultureInfoThe culture information used to format the date-time value. The default value is null which takes the current culture.
Exceptions
- ArgumentNullException
The font or the format is null.
RepDateTime(FontProp, DateTime?, string, CultureInfo?)
Initializes a new instance of the RepDateTime class with the specified font, nullable date-time, format and culture information.
public RepDateTime(FontProp font, DateTime? dateTime, string format, CultureInfo? cultureInfo = null)
Parameters
font
FontPropThe font for the date-time text.
dateTime
DateTime?The nullable date-time value.
format
stringThe format string used to format the date-time value.
cultureInfo
CultureInfoThe culture information used to format the date-time value. The default value is null which takes the current culture.
Exceptions
- ArgumentNullException
The font or the format is null.