Hello Everyone,
Following are the useful RTF functions:
Function Name | Example | Description |
---|---|---|
Substring | <?xdofx:substr(Field,Starting Position, length(Field))?> |
Fetches part of a string from starting position to the length of the string |
Sheet name for Excel output | <?spreadsheet-sheet-name:DesiredSheetName?> |
Provides static name for the sheet in Excel output |
For Loop | <?for-each:Groupname?> <?end for-each?> |
For loop in rtf |
If loop | <?if:Condition?> Example: <?if:Field!=0?> <?end if?> |
If loop in rtf |
Formatting Numbers | <?format-number:Field;'999G999D99'?> |
1000 separator for numbers |
Formatting Dates | <?format-date:Field;'Format'?> Example: <?format-date:Field;'XDODEFDATE'?> -prints date in the format dd/mm/yyyy |
|
Subtotals | <?sum(current-group()/Field)?> | Use this inside a loop to get the subtotal |
Parent tag/ field from different group | <?ancestor-or-self::*/Field?> | To fetch parent tags or parameter or any other fields |
Formatting Currency | <?format-currency:Field;//Currencycodefield?> Example: <?format-currency:Field;//'USD'?> |
|
Page Break | <?split-by-page-break:?> |
|
Value of | <xsl:value-of select=Field/> |
Can be used with xsl if or choose |
Choose | <xsl:choose> <xsl:when test="condition"> Field or data to be displayed when condition is satisfied </xsl:when> <xsl:otherwise> Field or data to be displayed when no conditions are satisfied </xsl:otherwise> </xsl:choose> |
Same as switch case in C language |