OData value (color) applied to SAPUI5 table - text

I wanted to know if the following is possible:
I've got an oData which has two fields related with colors
Colors are set as RGB because I thought it would be easier to pick them up to use it as styles in frontend.
I have a table in which I want to assign these colors to a specific cell, depending on 'ORGNA'.
I would like the row to have background-color red where Especialidad="UROLOGIA" (for example), but that color must come from the OData values I've got stored(see first image).
'ORGNA' values are the ones shown as 'Especialidad' (which means that 39ONC would be shown as 'Oncologia' and so on in the table).
I also wanted to know if this is possible or they must be set specifically from a Styles.css file.
Maybe there's some property like setColor or is there any way to add a background-color tag inside my XML View passing that OData values?
If you need any additional code, please just let me know.

Related

How to show different colour in the same data in tableau?

In tableau, I want the colours of my fields to be shown separately, but Tableau automatically creates a custom colour for both of the fields, which i do not want. Is there any way to show the fields in different colours? TIA
Also, if it is not possible, is there any way to do this in Python?
This is the way it looks right now
This is the colour setting

VBA Excel Get Color Conditional Formatting Ico

I am trying to get the colour of a set of conditional formatting's rule.
Here an example:
I am trying to get the colour of the arrow with the following method:
Sheet2.Cells(rwIndex, colIndex).Interior.ColorIndex
But is not working as I expected.
I tried to use also this function Sheet2.Cells(rwIndex, colIndex).Font.Color
And surprise, as I expected I get the desired colour.
Is there a way to get the colour of the arrow of the conditional formatting?
I found two helpful pages:
To get the background color of the cell if a Conditional Format is applied, you'd need:
Range.DisplayFormat.Interior.Color , see e.g. this page: http://www.cpearson.com/Excel/CFColors.htm
For the icons: you'd need to loop through the Range.FormatConditions and check which one applies. But still, I haven't been able to find the color of the icons, this is the list of all available icons: https://bettersolutions.com/excel/macros/enumerations-xlicon.htm and this are the IconSets: https://bettersolutions.com/excel/macros/enumerations-xliconset.htm , however, there seems to be no way to check out which individual icons are in an IconSet (which would be practical if you would make a custom set).
Hope that gets you started!

How to color specific vtkCells?

I have a 3D model loaded into a vtkActor and I need to be able to color specific vtkCells of this actor after selecting (clicking on those vtkCells). I know how to retrieve the selected cells from the vtkUnstructuredGrid but have no idea of how to set color to them. I've read a bit about vtkLookUpTables and think that might be it but I don't understand how it works, or if it really is what I need.
Thanks.
You can use vtkExtractCells to fetch all special cells and form a vtkDataObject, then create vtkDataSetMapper and vtkActor objects to color and shot it.

I wish to apply a background color to ONLY the cells in a specific dataGrid column?

I asked this question on the LiveCode email list. No response, so I figure it must not be possible. I know about editing the template graphic that enables alternating row colors. That doesn't help me.
This lesson is the closest to what I have found, but it only sets the overlay color to empty cells. It also had an unwanted affect, where any data that was present in the grid no longer shows up.
http://lessons.runrev.com/s/lessons/m/datagrid/l/7327-how-do-i-override-the-default-behavior-for-rendering-data-to-a-cell
As a little experiment, since the data became invisible (note that I'm on WinXP), I tried placing an opaque graphic over the column I wish to colorize. I set the ink of the graphic to AddMax or AddOver, and it looked nice, but the text in the cells disappeared. Then I tried setting the ink to AddMin, and it still looks good, but the test shows through!!!!
So, I think this will work fine visually, but how can I pass a double-click through this graphic to the cell underneath (to allow cell editing only within this column)?
Yes, you can do this.
This suggestion comes from Trevor DeVore at http://www.bluemangolearning.com/
Create a custom column template using the property inspector. From there you can edit the behavior of the column to colorize the background color of the field for that column or just edit the field in the template group to change the color.
The background color will only show up in rows that have data, however.

Dynamics AX - Color multiple grid cells in different colors

In Dynamics AX 2012, is there a way to change the background color of multiple cells to different colors?
Order Status Ship Status Order ID
[green] [red] SO-1234
[green] [green] SO-1235
[red] [red] SO-1236
I've written a displayOption override that can change the color of one cell, but it seems to apply all the changes at the end, so whatever the last color you specify is the one that gets applied to all cells.
_options.backColor(46080); //green
_options.affectedElementsByControl(OrderStatus.id());
//is there anyway to apply the first change, so I can make a second one?
_options.backColor(255); //red
_options.affectedElementsByControl(ShipStatus.id());
In the code listed above, both cell background colors would be red.
Any suggestions?
Thanks
I had a similar task to accomplish, and I did not find a way to do it in Ax (well, techinically you could try Table control, but I strongly encourage you NOT to do so - you will end up swearing out aloud).
What I did is implemented a WPF user control and used this post as a template.
This is a small tutorial (found in Answer #7) which shows how to implement a cell background converter in built-in WPF data grid control, to accomplish the task.
After you have it implemented you can populate your datagrid by using LINQ (if using AX 2012 R2), web services, or passing a temporary table - there are many ways to access AX data.
It may not be the ultimate solution, but it works.
I did it using a table control ( although Maciej advised you not to do ).
It works without problems.
You need to add a table control which gets your data and set the property
ColorScheme to RGB
Then, override the FormControl editControl(int column, int row)
You can access each value by value = data.cell(column, row).data(); whereby data is the name of the table control.
Beware, that you have to add a control with the correct datatype to the table control and give it a name. Also set the ColorScheme property to RGB.
If you got RGB values for your desired background color, setting this color can be done by
RealEdit.backgroundColor(WinAPI::RGB2int(real2int(R),real2int(G),real2int(B)));
RealEdit is the name of the added control.
I've done this to display a matrix filled with values between 0 and 1 and to display a color gradient overlay with a range from green to red. See this link, if you like more information about the color conversion.

Resources