Report control:highlight row base on the value of a field(or fields)


Yang Ghua

Is there a way to make record rows in Report control to stand out on the basis of the rows' specified field value?


decsoft

Hello to all,

Is there a way to make record rows in Report control to stand out on the basis of the rows' specified field value?

I am not sure if can understand Joshua, please, can you explain a little more?



Yang Ghua

ok,I try to explain more specific

A Report control contain a list of records,and each row has a field 'name',
I want to highlight the rows with field ('name')='Joshua',maybe row background color ,or font color,
So these 'Joshua' rows seems different from other row records


decsoft

Hello to all,

Thanks for the explanation! Certainly, there is more than one way to achieve what you wanted. Here are some of them. We can use the "ng-style" in one or more "TD" elements (if we play with a "Report / table": may more easy if we play with a "Report / grid") in the below way:

The above works, but, maybe we prefer to use a CSS class instead to apply certain style directly, so the code can appear like the below one:

In the above code, we are set the "match-name" CSS class for a Record's name which is equal to "Abel". Note that we can add more than one CSS class:

In the above case, we add the "match-name" and "other-class" CSS classes. You know this CSS classes can be defined in the app's Inline CSS option or in a separated CSS file added to the app.

Other additional possibility is to add a CSS when the name is not matched, and, for example, in the below code:

The above code add the "match-name" CSS class if the Record's "Name" is "Abel", and, on the contrary, add the "no-match-name" CSS class if the Record's "Name" is NOT "Abel".

Try with that code Joshua! Post here if you have any further questions.


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.