I. Description
Multiple data and texts are displayed in a cell by formulas, hoping to change the style of only part of the content, such as: the color of the data obtained by the sum formula becomes red, the color of the text is black, etc. If it is implemented using multiple cells, the format is not easy to adjust and the implementation effect is not good, so the display effect can be achieved through HTML as shown in the figure below:
II. Idea
Use the formula CONCATENATE to concatenate strings, use the font tag in HTML for string, set the value of color, and set the corresponding cell to Display by HTML.
III. Example
1. Open the template
Open the template: %FR_HOME%\webapps\webroot\\WEB-INF\reportlets\doc-EN\Primary\GroupReport\Vertical_Group_Report.cpt
2. Enter HTML
Cell C4 is a simple summary. I hope to splice the region and the total sales volume and set different styles.
Use the formula =CONCATENATE("<h3><font color=black>",A2,"<font color=red>---",SUM(C3))
CONCATENATE is to combine multiple strings into one string. Among them, h3 is to define the size of the title, use the font tag to set the color properties black and red, 'A2' is to get the value of A2 cell, SUM (C3) is to sum up the region.
3. Display by HTML
Click C4, right-click to select Other, and check Display by HTML, as shown in the figure below:
4. Pagination preview
Click Pagination Preview, you can see that the regions in the corresponding cell are displayed in black, and the number is displayed in red.