Overview
Version
| Report Server Version | Functional Change |
|---|---|
| 11.0 | / |
Function Description
Formula Form in Cell Attribute can be seen as a more complex form of Data Dictionary. You can use Formula Form to convert actual and display values, and display data in the required format.
Example One: Date Format Conversion
A column of date data is stored in a database in the format of yyyy-MM-dd. When displaying the data in a report, you need to convert the data into the format of abbreviated English month-dd. Since the effect cannot be achieved only with the Data Dictionary setting, you need to use Formula Form in Cell Attribute.
Dataset Creation
Create a built-in dataset ds2.

Formula Form Setting
Right-click cell A2 (where the Arrival Date field is located), choose Display > Formula Form, and enter the formula value("ds2", 2, 1, mid($$$, 6, 2), 1) + "-" + mid($$$, 9, 2). The formula is used to extract the value from the second column of the dataset ds2 where the values in the first column match the months in the cell, and concatenate the obtained values with - and the values corresponding to dd from the cell For example, 2009-01-03 is displayed as Jan-03.

For details about using the Value function, see Value Function.
Effect Display
PC
The following figure shows the preview effect.

Mobile Terminal
The preview effects on the DataAnalyst app and the HTML5 terminal are the same, as shown in the following figure.

Example Two: Displaying the Default Value When the Cell Value is Empty
Sometimes, nothing is displayed in cells when the values of certain fields are null. How to display default values in these cells?
Formula Insertion
You can insert the formula if(len($$$)==0,0,$$$) under Display > Formula Form. In this case, data is displayed if the current cells contain data. Otherwise, 0 is displayed in the cell, as shown in the following figure.

Effect Display
PC
The following figure shows the effect.

Mobile Terminal
The preview effects on the DataAnalyst app and the HTML5 terminal are the same, as shown in the following figure.

Template Download
Example One: Date Format Conversion
For details, you can download the template Formula Form - Date Format Conversion.cpt.
Example Two: Displaying the Default Value When the Cell Value is Empty
For details, you can download the template Formula Form - Displaying the Default Value When the Cell Value is Empty.cpt.