Reflex Blue Report Functions
Below is an overview of the available report functions in the Reflex Blue category. These functions can be used in expressions in the report layout.
AreDatesEqual function
The AreDatesEqual function compares two dates, disregarding the time.
Definition
bool AreDatesEqual(object date1, object date2) Parameters
| Name | Description |
|---|---|
date1 | The date you want to compare. |
date2 | The date you want to compare to. |
Return value
A boolean value indicating whether the dates are equal or not.
Chunk function
Returns the value partitioned by the size of the chunk. The page number is used to calculate the value for the current partition.
Definition
decimal Chunk(object value, object chunkSize, int pageNumber) Parameters
| Name | Description |
|---|---|
value | The value determining the ratio. |
chunkSize | The size of each partition. |
pageNumber | The current page number. |
Return value
The size of the partition based on the page number.
Voorbeeld
A value of 10 and chuckSize of 3 returns 3 for pageNumbers 1, 2, and 3 because ‘3’ fits three times in the number 10, and 1 for pageNumber 4 because that is the remainder.
Coalesce function
The Coalesce function returns the first non-null value from the provided values. This function has four variants allowing comparison of from two up to a maximum of five values at a time.
Definitions
object Coalesce(object value1, object value2)
object Coalesce(object value1, object value2, object value3)
object Coalesce(object value1, object value2, object value3, object value4)
object Coalesce(object value1, object value2, object value3, object value4, object value5) Parameters
| Name | Description |
|---|---|
value1 t/m value5 | The values to compare. |
Return value
The first non-null value.
ISOWeek function
The ISOWeek function returns the week number based on the ISO 8601 standard.
Definition
int ISOWeek(DateTime date) Parameters
| Name | Description |
|---|---|
date | The date to get the week number for. |
Return value
The week number as an integer.
ToRatio function
Uses the ratio of another value to calculate a new value that has the same ratio.
Definition
decimal ToRatio(object toRatio, object value, object chunkSize, int pageNumber) Parameters
| Name | Description |
|---|---|
toRatio | The value to be divided by the same ratio. |
value | The value determining the ratio. |
chunkSize | The size of each partition. |
pageNumber | The current page number. |
Return value
The size of the partition based on the page number.
Example
A toRatio of 200, value of 10, and chunkSize of 3 returns 60 for pageNumbers 1, 2, and 3 because ‘3’ fits three times in 10, and likewise ‘60’ fits three times in 200, and 20 is the remainder for pageNumber 4.
Translate function
The Translate function can be used to display translations of data in a report. To use this function, the object or entity on which this function is applied must support translations.
Definition
string Translate(object businessObject, string columnName, object language) Parameters
| Name | Description |
|---|---|
businessObject | The object that supports translations. |
columnName | The column of the object you want to translate. |
language | The Identifier of the language to which you want to translate the data in the column. The Identifier of the language is provided when adding the language in Reflex Blue. |
Return value
Translates the column of the specified object into the specified language and returns the translation as text. Returns null if there is no translation.
Example
The translate function can be used in a report expression as follows:
{Translate(FoodInformation, "PresentAllergens", "GERMAN")} In the above example, the column PresentAllergens of the report object FoodInformation is translated into German.
It is also possible to pass variables to the function for the language. For example, if there is also a Relation object present in the report, then the DefaultLanguage of the relation could be used to translate to the language specified at the relation.
{Translate(OrderLine.Article, "Name", Relation.DefaultLanguage.Identifier)} In the above example, the column Name of the report object Orderline.Article is translated into the default language specified at the relation.
VatToDutch function
The VatToDutch function displays the name of the VAT type in Dutch.
Definition
string VatToDutch(string vatType) Parameters
| Name | Description |
|---|---|
vatType | The VAT type you want to display in Dutch. |
Return value
The VAT type in Dutch in text format.
VatToFrench function
The VatToFrench function displays the name of the VAT type in French.
Definition
string VatToFrench(string vatType) Parameters
| Name | Description |
|---|---|
vatType | The VAT type you want to display in French. |
Return value
The VAT type in French in text format.
VatToGerman function
The VatToGerman function displays the name of the VAT type in German.
Definition
string VatToGerman(string vatType) Parameters
| Name | Description |
|---|---|
vatType | The VAT type you want to display in German. |
Return value
The VAT type in German in text format.
VatToSpanish function
The VatToSpanish function displays the name of the VAT type in Spanish.
Definition
string VatToSpanish(string vatType) Parameters
| Name | Description |
|---|---|
vatType | The VAT type you want to display in Spanish. |
Return value
The VAT type in Spanish in text format.