I. Overview
1.1 Problem Description
Subscripts need to be set rich text or realized by two cells, but if it is expanded data, how to realize it?
For example, to realize the subscript of the chemical formula, the effect is as shown in the figure below:
1.2 Realization Ideas
Use formula to identify the subscript numbers in the string, and then combine with HTML tags to achieve.
II. Example
2.1 Prepare Data
Create a built-in dataset, as shown in the following figure:
2.2 Design Table
1) Drag the 2 fields of the built-in dataset into the table, as shown in the figure below:
2) Add a new column at the back and set the formula in cell C2: JOINARRAY(MAPARRAY(SPLIT(B2,""),IF(REGEXP(item,"[0-9]"),"<sub>"+item+ "</sub>",item)),""), as shown in the figure below:
3) C2 cell setting uses Display by HTML, as shown in the figure below:
2.3 Effect Preview
1) PC
Save the report, click the Pagination Preview, the effect is as shown in the figure below:
2) Mobile
Both App and H5 are supported at the same time, and the effect is shown in the figure below:
III. Template Download
Refer to the completed template:%FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\ReportApplication\BasicApplication\Extended_data_to_achieve_subscripts.cpt
Click to download:
IV. Precautions
Additional explanation, the superscript and subscript tags in HTML, as shown in the following table:
Function | Label | Example |
Superscript | <sup> | Normal text <sup>Superscript</sup> |
Subscript | <sub> | Normal text <sub>Subscript</sub> |