Wednesday, May 4, 2011

Cheat Sheet for Crystal Report Formulas

Conversion Functions:
Conversion Function
Description
CBool(number), CBool(currency)
Convert to Boolean.
CCur(number), CCur(string)
Convert to Currency.
CDbl(currency), CDbl(string),
CDbl(boolean)
Convert to Number. Equivalent to ToNumber().
CStr()
Convert to String. Equivalent to ToText().
CDate(string), CDate(year, month, day), CDate(DateTime)
Convert to Date.
CTime(string), CTime(hour, min, sec), CDate(DateTime)
Convert to Time.
CDateTime(string),
CDateTime(date),
CDateTime(date, time),
CDateTime(year, month, day)
Convert to DateTime.
CDateTime(year, month, day, hour, min, sec)
Convert to DateTime.
ToNumber(string), ToNumber(boolean)
Convert to a Number.
ToText()
Convert to String. Same as CStr().
IsDate(string), IsTIme(), IsDateTime()
Test a string for being a valid date/time.
IsNumber(string)
Test a string for being a valid number.
ToWords(number),
ToWords(number, decimals)
Convert a number to its word equivalent.


·         Formula = ToWords(123.45) Result is one hundred twenty-three 45 / 100
 Math Functions:
Function Name
Description
Abs(number)
Return the absolute value.
Fix(number, decimals)
Return a number with a specified number of significant digits.
Int(number), numerator \ denominator
Return the integer portion of a fractional number.
Remainder(numerator, denominator),
Return the remainder of dividing the numerator by the denominator.
numerator Mod denominator
Return the remainder of dividing the numerator by the denominator.
Round(number, decimals)
Round up a number with a specified number of significant digits.
Sgn(number)
Return a number's sign.
Sqr(number), Exp(number), Log(number)
The standard arithmetic functions.
Cos(number), Sin(number), Tan(number), Atn(number)
The standard scientific functions.


Convert display string to cost: 
CStr (CCur(ToNumber({Data.SupplyCost})/100))

New Line in formula : ChrW(13)
New Line in XML     :  

Alternate Row Color:
if RecordNumber mod 2 = 0 then crSilver else crNoColor



3-Formula Trick:     Init/Calc/Display:










No comments:

Post a Comment

RootComponent types in solution.xml file in Dynamics CRM 365/2016

In Microsoft Dynamic CRM 2016/365 are you as confused as me when looking at the solution.xml from the solution export? looking at the xml a...