Class StdFunctions
Namespace: FastReport.Olap.Functions
Assembly: FastCube.Core.dll
Contains standard functions registered in the "Data" window.
public static class StdFunctions
Inheritance
Methods
AddDays(DateTime, double)
Adds the specified number of days to the original date.
public static DateTime AddDays(DateTime date, double value)
Parameters
date
DateTime
The original date.
value
double
A number of whole and fractional days.
Returns
A new DateTime value.
AddHours(DateTime, double)
Adds the specified number of hours to the original date.
public static DateTime AddHours(DateTime date, double value)
Parameters
date
DateTime
The original date.
value
double
A number of whole and fractional hours.
Returns
A new DateTime value.
AddMinutes(DateTime, double)
Adds the specified number of minutes to the original date.
public static DateTime AddMinutes(DateTime date, double value)
Parameters
date
DateTime
The original date.
value
double
A number of whole and fractional minutes.
Returns
A new DateTime value.
AddMonths(DateTime, int)
Adds the specified number of months to the original date.
public static DateTime AddMonths(DateTime date, int value)
Parameters
date
DateTime
The original date.
value
int
A number of months.
Returns
A new DateTime value.
AddSeconds(DateTime, double)
Adds the specified number of seconds to the original date.
public static DateTime AddSeconds(DateTime date, double value)
Parameters
date
DateTime
The original date.
value
double
A number of whole and fractional seconds.
Returns
A new DateTime value.
AddYears(DateTime, int)
Adds the specified number of years to the original date.
public static DateTime AddYears(DateTime date, int value)
Parameters
date
DateTime
The original date.
value
int
A number of years.
Returns
A new DateTime value.
Asc(char)
Returns an integer value representing the character code corresponding to a character.
public static int Asc(char c)
Parameters
c
char
Character to convert.
Returns
The character code.
Choose(double, params object[])
Selects and returns a value from a list of arguments.
public static object Choose(double index, params object[] choice)
Parameters
index
double
A value between 1 and the number of elements passed in the "choice" argument.
choice
object[]
Object parameter array.
Returns
One of the values in the "choice" argument.
Chr(int)
Returns the character associated with the specified character code.
public static char Chr(int i)
Parameters
i
int
Character code to convert.
Returns
The character.
DateDiff(DateTime, DateTime)
Subtracts the specified date and time from the original date.
public static TimeSpan DateDiff(DateTime date1, DateTime date2)
Parameters
date1
DateTime
The original date.
date2
DateTime
The date and time to subtract.
Returns
A TimeSpan interval between two dates.
DateSerial(int, int, int)
Initializes a new instance of the DateTime.
public static DateTime DateSerial(int year, int month, int day)
Parameters
year
int
The year.
month
int
The month.
day
int
The day.
Returns
A new DateTime value.
Day(DateTime)
Gets the day of the month.
public static int Day(DateTime date)
Parameters
date
DateTime
The date value.
Returns
The day component.
DayOfWeek(DateTime)
Gets the localized name of the day of the week.
public static string DayOfWeek(DateTime date)
Parameters
date
DateTime
The date value.
Returns
The name of the day of the week.
DayOfYear(DateTime)
Gets the day of the year.
public static int DayOfYear(DateTime date)
Parameters
date
DateTime
The date value.
Returns
The day of the year.
DaysInMonth(int, int)
Returns the number of days in the specified month and year.
public static int DaysInMonth(int year, int month)
Parameters
year
int
The year.
month
int
The month.
Returns
The number of days in month for the specified year.
Format(string, params object[])
Replaces the format item in a specified String with the text equivalent of the value of a corresponding Object instance in a specified array.
public static string Format(string format, params object[] args)
Parameters
format
string
A String containing zero or more format items.
args
object[]
An Object array containing zero or more objects to format.
Returns
A copy of format in which the format items have been replaced by the String equivalent of the corresponding instances of Object in args.
FormatCurrency(object)
Returns a string formatted as a currency value.
public static string FormatCurrency(object value)
Parameters
value
object
The value to format.
Returns
The formatted string.
FormatCurrency(object, int)
Returns a string formatted as a currency value with specified number of decimal digits.
public static string FormatCurrency(object value, int decimalDigits)
Parameters
value
object
The value to format.
decimalDigits
int
Number of decimal digits.
Returns
The formatted string.
FormatDateTime(DateTime)
Returns a string formatted as a date/time value.
public static string FormatDateTime(DateTime value)
Parameters
value
DateTime
The value to format.
Returns
The formatted string.
FormatDateTime(DateTime, string)
Returns a string formatted as a date/time value.
public static string FormatDateTime(DateTime value, string format)
Parameters
value
DateTime
The value to format.
format
string
The format specifier, one of the "Long Date", "Short Date", "Long Time", "Short Time" values.
Returns
The formatted string.
FormatNumber(object)
Returns a string formatted as a numeric value.
public static string FormatNumber(object value)
Parameters
value
object
The value to format.
Returns
The formatted string.
FormatNumber(object, int)
Returns a string formatted as a numeric value with specified number of decimal digits.
public static string FormatNumber(object value, int decimalDigits)
Parameters
value
object
The value to format.
decimalDigits
int
Number of decimal digits.
Returns
The formatted string.
FormatPercent(object)
Returns a string formatted as a percent value.
public static string FormatPercent(object value)
Parameters
value
object
The value to format.
Returns
The formatted string.
FormatPercent(object, int)
Returns a string formatted as a percent value with specified number of decimal digits.
public static string FormatPercent(object value, int decimalDigits)
Parameters
value
object
The value to format.
decimalDigits
int
Number of decimal digits.
Returns
The formatted string.
Hour(DateTime)
Gets the hour component of the date.
public static int Hour(DateTime date)
Parameters
date
DateTime
The date.
Returns
The hour component.
IIf(bool, object, object)
Returns one of two objects, depending on the evaluation of an expression.
public static object IIf(bool expression, object truePart, object falsePart)
Parameters
expression
bool
The expression you want to evaluate.
truePart
object
Returned if Expression evaluates to True.
falsePart
object
Returned if Expression evaluates to False.
Returns
Either truePart os falsePart.
Insert(string, int, string)
Inserts a specified string at a specified index position in the original string.
public static string Insert(string s, int startIndex, string value)
Parameters
s
string
The original string.
startIndex
int
The index position of the insertion.
value
string
The string to insert.
Returns
A new string.
Length(string)
Gets the number of characters in a string.
public static int Length(string s)
Parameters
s
string
The original string.
Returns
The number of characters.
LowerCase(string)
Converts a specified string to lowercase.
public static string LowerCase(string s)
Parameters
s
string
The string to convert.
Returns
A string in lowercase.
Maximum(int, int)
Returns the larger of two 32-bit signed integers.
public static int Maximum(int val1, int val2)
Parameters
val1
int
The first of two values to compare.
val2
int
The second of two values to compare.
Returns
Parameter val1 or val2, whichever is larger.
Maximum(long, long)
Returns the larger of two 64-bit signed integers.
public static long Maximum(long val1, long val2)
Parameters
val1
long
The first of two values to compare.
val2
long
The second of two values to compare.
Returns
Parameter val1 or val2, whichever is larger.
Maximum(float, float)
Returns the larger of two single-precision floating-point numbers.
public static float Maximum(float val1, float val2)
Parameters
val1
float
The first of two values to compare.
val2
float
The second of two values to compare.
Returns
Parameter val1 or val2, whichever is larger.
Maximum(double, double)
Returns the larger of two double-precision floating-point numbers.
public static double Maximum(double val1, double val2)
Parameters
val1
double
The first of two values to compare.
val2
double
The second of two values to compare.
Returns
Parameter val1 or val2, whichever is larger.
Maximum(decimal, decimal)
Returns the larger of two decimal numbers.
public static decimal Maximum(decimal val1, decimal val2)
Parameters
val1
decimal
The first of two values to compare.
val2
decimal
The second of two values to compare.
Returns
Parameter val1 or val2, whichever is larger.
Minimum(int, int)
Returns the smaller of two 32-bit signed integers.
public static int Minimum(int val1, int val2)
Parameters
val1
int
The first of two values to compare.
val2
int
The second of two values to compare.
Returns
Parameter val1 or val2, whichever is smaller.
Minimum(long, long)
Returns the smaller of two 64-bit signed integers.
public static long Minimum(long val1, long val2)
Parameters
val1
long
The first of two values to compare.
val2
long
The second of two values to compare.
Returns
Parameter val1 or val2, whichever is smaller.
Minimum(float, float)
Returns the smaller of two single-precision floating-point numbers.
public static float Minimum(float val1, float val2)
Parameters
val1
float
The first of two values to compare.
val2
float
The second of two values to compare.
Returns
Parameter val1 or val2, whichever is smaller.
Minimum(double, double)
Returns the smaller of two double-precision floating-point numbers.
public static double Minimum(double val1, double val2)
Parameters
val1
double
The first of two values to compare.
val2
double
The second of two values to compare.
Returns
Parameter val1 or val2, whichever is smaller.
Minimum(decimal, decimal)
Returns the smaller of two decimal numbers.
public static decimal Minimum(decimal val1, decimal val2)
Parameters
val1
decimal
The first of two values to compare.
val2
decimal
The second of two values to compare.
Returns
Parameter val1 or val2, whichever is smaller.
Minute(DateTime)
Gets the minute component of the date.
public static int Minute(DateTime date)
Parameters
date
DateTime
The date.
Returns
The minute component.
Month(DateTime)
Gets the month component of the date.
public static int Month(DateTime date)
Parameters
date
DateTime
The date.
Returns
The month component.
MonthName(int)
Gets the localized month name.
public static string MonthName(int month)
Parameters
month
int
The month number.
Returns
The month name.
PadLeft(string, int)
Right-aligns the characters in a string, padding with spaces on the left for a specified total length.
public static string PadLeft(string s, int totalWidth)
Parameters
s
string
The original string.
totalWidth
int
The number of characters in the resulting string.
Returns
Right-aligned string, padded on the left with spaces.
PadLeft(string, int, char)
Right-aligns the characters in a string, padding on the left with a specified character for a specified total length.
public static string PadLeft(string s, int totalWidth, char paddingChar)
Parameters
s
string
The original string.
totalWidth
int
The number of characters in the resulting string.
paddingChar
char
A padding character.
Returns
Right-aligned string, padded on the left with padding characters.
PadRight(string, int)
Left-aligns the characters in a string, padding with spaces on the right, for a specified total length.
public static string PadRight(string s, int totalWidth)
Parameters
s
string
The original string.
totalWidth
int
The number of characters in the resulting string.
Returns
Left-aligned string, padded on the right with spaces.
PadRight(string, int, char)
Left-aligns the characters in a string, padding on the right with a specified character, for a specified total length.
public static string PadRight(string s, int totalWidth, char paddingChar)
Parameters
s
string
The original string.
totalWidth
int
The number of characters in the resulting string.
paddingChar
char
A padding character.
Returns
Left-aligned string, padded on the right with padding characters.
Remove(string, int)
Deletes all the characters from a string beginning at a specified position.
public static string Remove(string s, int startIndex)
Parameters
s
string
The original string.
startIndex
int
The position to begin deleting characters.
Returns
A new string.
Remove(string, int, int)
Deletes a specified number of characters from a string beginning at a specified position.
public static string Remove(string s, int startIndex, int count)
Parameters
s
string
The original string.
startIndex
int
The position to begin deleting characters.
count
int
The number of characters to delete.
Returns
A new string.
Replace(string, string, string)
Replaces all occurrences of a specified string in the original string, with another specified string.
public static string Replace(string s, string oldValue, string newValue)
Parameters
s
string
The original string.
oldValue
string
A string to be replaced.
newValue
string
A string to replace all occurrences of oldValue.
Returns
A new string.
Second(DateTime)
Gets the seconds component of the date.
public static int Second(DateTime date)
Parameters
date
DateTime
The date.
Returns
The seconds component.
Substring(string, int)
Retrieves a substring from the original string, starting at a specified character position.
public static string Substring(string s, int startIndex)
Parameters
s
string
The original string.
startIndex
int
The starting character position of a substring.
Returns
A new string.
Substring(string, int, int)
Retrieves a substring from the original string, starting at a specified character position, with a specified length.
public static string Substring(string s, int startIndex, int length)
Parameters
s
string
The original string.
startIndex
int
The starting character position of a substring.
length
int
The number of characters in the substring.
Returns
A new string.
Switch(params object[])
Evaluates a list of expressions and returns a value corresponding to the first expression in the list that is True.
public static object Switch(params object[] expressions)
Parameters
expressions
object[]
Parameter array consists of paired expressions and values.
Returns
The value corresponding to an expression which returns true.
TitleCase(string)
Converts the specified string to titlecase.
public static string TitleCase(string s)
Parameters
s
string
The string to convert.
Returns
A new string.
ToRoman(object)
Converts a numeric value to Roman string representation.
public static string ToRoman(object value)
Parameters
value
object
Integer value in range 0-3998.
Returns
The string in Roman form.
ToWords(object)
Converts a currency value to an english (US) string representation of that value.
public static string ToWords(object value)
Parameters
value
object
The currency value to convert.
Returns
The string representation of the specified value.
ToWords(object, string)
Converts a currency value to an english (US) string representation of that value, using the specified currency.
public static string ToWords(object value, string currencyName)
Parameters
value
object
The currency value to convert.
currencyName
string
The 3-digit ISO name of the currency, for example "EUR".
Returns
The string representation of the specified value.
ToWords(object, string, string)
Converts a numeric value to an english (US) string representation of that value.
public static string ToWords(object value, string one, string many)
Parameters
value
object
The numeric value to convert.
one
string
The name in singular form, for example "page".
many
string
The name in plural form, for example "pages".
Returns
The string representation of the specified value.
ToWordsEnGb(object)
Converts a currency value to an english (GB) string representation of that value.
public static string ToWordsEnGb(object value)
Parameters
value
object
The currency value to convert.
Returns
The string representation of the specified value.
ToWordsEnGb(object, string)
Converts a currency value to an english (GB) string representation of that value, using the specified currency.
public static string ToWordsEnGb(object value, string currencyName)
Parameters
value
object
The currency value to convert.
currencyName
string
The 3-digit ISO name of the currency, for example "EUR".
Returns
The string representation of the specified value.
ToWordsEnGb(object, string, string)
Converts a numeric value to an english (GB) string representation of that value.
public static string ToWordsEnGb(object value, string one, string many)
Parameters
value
object
The numeric value to convert.
one
string
The name in singular form, for example "page".
many
string
The name in plural form, for example "pages".
Returns
The string representation of the specified value.
ToWordsEs(object)
Converts a currency value to a spanish string representation of that value.
public static string ToWordsEs(object value)
Parameters
value
object
The currency value to convert.
Returns
The string representation of the specified value.
ToWordsEs(object, string)
Converts a currency value to a spanish string representation of that value, using the specified currency.
public static string ToWordsEs(object value, string currencyName)
Parameters
value
object
The currency value to convert.
currencyName
string
The 3-digit ISO name of the currency, for example "EUR".
Returns
The string representation of the specified value.
ToWordsEs(object, string, string)
Converts a numeric value to a spanish string representation of that value.
public static string ToWordsEs(object value, string one, string many)
Parameters
value
object
The numeric value to convert.
one
string
The name in singular form, for example "page".
many
string
The name in plural form, for example "pages".
Returns
The string representation of the specified value.
ToWordsRu(object)
Converts a currency value to a russian string representation of that value.
public static string ToWordsRu(object value)
Parameters
value
object
The currency value to convert.
Returns
The string representation of the specified value.
ToWordsRu(object, string)
Converts a currency value to a russian string representation of that value, using the specified currency.
public static string ToWordsRu(object value, string currencyName)
Parameters
value
object
The currency value to convert.
currencyName
string
The 3-digit ISO name of the currency, for example "EUR".
Returns
The string representation of the specified value.
ToWordsRu(object, bool, string, string, string)
Converts a numeric value to a russian string representation of that value.
public static string ToWordsRu(object value, bool male, string one, string two, string many)
Parameters
value
object
The numeric value to convert.
male
bool
True if the name is of male gender.
one
string
The name in singular form, for example "страница".
two
string
The name in plural form, for example "страницы".
many
string
The name in plural form, for example "страниц".
Returns
The string representation of the specified value.
Trim(string)
Removes all occurrences of white space characters from the beginning and end of the original string.
public static string Trim(string s)
Parameters
s
string
The original string.
Returns
A new string.
UpperCase(string)
Converts a specified string to uppercase.
public static string UpperCase(string s)
Parameters
s
string
The string to convert.
Returns
A string in uppercase.
WeekOfYear(DateTime)
Gets the week of the year.
public static int WeekOfYear(DateTime date)
Parameters
date
DateTime
The date value.
Returns
The week of the year.
Year(DateTime)
Gets the year component of the date.
public static int Year(DateTime date)
Parameters
date
DateTime
The date.
Returns
The year component.