I. Problem description
When you perform fuzzy query on a report, the fuzzy keywords are highlighted in the data columns that you want to query. As follows:
II. Solution
In the corresponding data column, the included keywords are converted into HTML tags with highlighted colors, and then displayed using HTML.
III. Solution steps
1) Create data set query:SELECT * FROM Sales_Volume where 1=1 ${if(len(name)=0,"","and Salesperson like '%"+name+"%'")}
2) The report design is as follows. Drag the fields to the corresponding cell and set D2 to summary summation.
3) Set cell B2 Display - Formula Form. Formula is:replace($$$,$name,"<font color='red'>"+$name+"</font>")
4) Choose to display the content in HTML
5) Add corresponding widgets to the parameter panel and save the preview.
IV. Preview the effect
1) PC
Save the template and clickPagination Preview to achieve the effect shown in the description.
2) Mobile
1) App effect
2) H5 effect
V. Complete the template
You have completed the template. For details, see%FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Parameter\Text_widget_fuzzy_query_keyword_highlighting.cpt.
Click to download the template:
Text_widget_fuzzy_query_keyword_highlighting.cpt