Oracle Apex column value conditional display - oracle-apex

I used the query below in interactive report and turned escape special characters off. This is just coloring text whereas requirement is to highlight entire row.
Any suggestions?
Ex:
SELECT "P_IT_ISSUES"."ISSUE_SUMMARY" as "ISSUE_SUMMARY",
decode("P_IT_PEOPLE_1"."PERSON_NAME",NULL,'Unassigned',
"P_IT_PEOPLE_1"."PERSON_NAME")
as "ASSIGNED_TO",
case when "P_IT_ISSUES"."STATUS" ='Open'
then '<aaab style= " color: green; " >'
||"P_IT_ISSUES"."STATUS"||'</aaab>'
when "P_IT_ISSUES"."STATUS" ='On-Hold'
then '<aaab style= " color: red; " >'
||"P_IT_ISSUES"."STATUS"||'</aaab>'
else '<aaab style= " color: red; " >'
||"P_IT_ISSUES"."STATUS"||'</aaab>'
end "Status"
FROM "P_IT_PEOPLE" "P_IT_PEOPLE_1",
"P_IT_DEPARTMENTS" "P_IT_DEPARTMENTS",
"P_IT_PEOPLE" "P_IT_PEOPLE",
"P_IT_ISSUES" "P_IT_ISSUES"
WHERE "P_IT_ISSUES"."IDENTIFIED_BY_PERSON_ID"="P_IT_PEOPLE"."PERSON_ID"
AND "P_IT_ISSUES"."ASSIGNED_TO_PERSON_ID"="P_IT_PEOPLE_1"."PERSON_ID"(+)
AND "P_IT_ISSUES"."RELATED_DEPT_ID"="P_IT_DEPARTMENTS"."DEPT_ID"

I need to do a revised version of this post
http://www.grassroots-oracle.com/2013/06/highlight-cell-background-in-apex-report.html
To highlight the entire cell/row, you need to apply a conditional class to your column, similar to how you're doing now - but could be a simple value.
First, add a hidden column to your query.
case when status = 'X' then 'foo' else 'bar' end my_class
which you would add as HTML expression of a visible column, eg: the status column.
<span class="#MY_CLASS#">#STATUS#</span>
Then have an after-refresh dynamic action with JS, ensuring 'fire in initialisation' is checked.
This JS looks for any elements with that class, then climbs the DOM to find the relevant cell/row, and applies a colour to the row.
$("#my_report_static_id .foo").each(function(){
$(this).closest('tr').css({"background-color":"red"});
});
You could parameterise that colour, if necessary, using similar techniques.

Related

Coloring a table in apache superset

I want to color the background bars (or the entire cells) of the table as shown in the appended screenshot based on the "Group-By"/dimension value (red for "rot", yellow for "gelb" and green for "grĂ¼n").
I was able to color the metric-part of other visualizations with label_colors, but I have not yet found a way to color the cells of the table based on a "dimension".
Is there a way to do this?
As of now:
EDIT: I wanted to color it the following way (edited with paint):
This is a tad hacky, but you can add a markdown component and add the following markup:
<style>
th {
color: red; /* or whatever color/hex code you want */
}
</style>
The markdown component will be blank after you add this--i.e. there will just be a blank markdown block-- so you may want to add some copy. Alternatively, if you already have a markdown block, you can add it there, and it won't appear as long as you remember the <style></style> tags.

Infragistics UltraGrid cell different color per word

Is it possible to change the color of a word in a text value of a Ultragrid Cell?
for example: 7m + 5m + 7m2 where 7m2 is in red color.
I am going to implement this in my windows application.
You need to set the Style of the column to FormattedText / FormattedTextEditor. Then you need to set the value of the Cell to some formatted text. In your case you could set the value to something like this:
var cellValue = "7m + 5m + <span style=\"color:Red;\">7m<span style=\"vertical - align:Super;\">2</span></span>";

Data Preperation Identify String using Regex and move to new column

Hello I am using Talend to prepare product data for import into DB. I want to use the extract string parts function for Talend.
I have the following data in one cell. (The length of the data varies not a fixed width format)
Measurement: Ring Head Width: 6.8 Ring Height: 5.5 Ring Shank Width: 1.1 Ladies Band Width: 2.5 Ladies band shank Width: 1.2
I need help creating a regex format to match each measurement value and extract it to a new column.
What would be Regex to match the following text ?
Ring Head Width: 6.8
and extract the numeric value following it, which is
6.8
Similarly I want to create regex for all the above measurements. I am assuming the format will be the same.
Thank for your time and help.
If you don't bother using multiple actions to acheive this result I suggest that you use:
the "Split text in parts" action on ":"
and then use "remove whitespaces" to have a clean value.
If you really need to keep one action, you have the "Remove part of the text" action on regex that is based on the java Pattern.
Using regex ".*:\s" works fine

Display labels on bar chart using Chart.js

I am trying to display labels on top of bars using chart.js. My Y.-Axis has custom labels, like: scaleLabel : "<%= value + '$' %>"
So, my bar chart y.axis would be something like 1000$, 2000$ etc..
When I display lables on top of each bar, the values are displayed as 1000, 2000 etc..
Is there a way to display custom y-axis label on top of each bar?
I am looking something like, instead of 5000, how can i display "5000$" on top of each bar?
If you have a single dataset set the tooltipTemplate in the options.
If you have several datasets set the multiTooltipTemplate in the options.
var options = {
scaleLabel : "<%= value + '$' %>",
// String - Template string for single tooltips
tooltipTemplate: "<%if (label){%><%=label %>: <%}%><%= value + '$' %>",
// String - Template string for multiple tooltips
multiTooltipTemplate: "<%= value + '$' %>",
};
See an example here.
And the documentation here.

How can I import and use labels from one Stata file to the current?

I have file aa with a variable x which is labeled with value label x_lab. I would like to use this value label on the variable x of Stata file bb:
use bb, clear
label value x x_lab
How can I import the value label x_lab?
You can use label save, which saves value labels in a do-file:
label save x_lab using label.do
use bb, clear
do label.do
See Stata help for label.
This answer technique didn't work for me as I wanted the variable labels created with e.g. label var connected "connected household", not the value labels.
Instead I used this advice: http://statalist.1588530.n2.nabble.com/st-How-to-export-variables-window-td3937733.html
*************
sysuse auto, clear
log using mylog, name(newlog) replace
foreach var of varlist _all{
di _col(3) "`var'" _col(20) "`:var label `var''"
}
log close newlog
//translate from proprietary format
translate mylog.smcl mylog.txt, replace
!start mylog.txt
*************
To fix the labels that extended over multiple lines so they just used a single one, I then replaced the \n > for the oversized labels with nothing (in regex mode in atom). I could easily save into TSV from there.
Specifically:
Clean up header and footer text in the logfile output.
On Mac: use "\n" instead of "\r\n".
On Windows: first "\r\n -> ""
then whitespace at beginning "\r\n " --> "\r\n"
then convert whitespace with 3 or more spaces in middle to tabs " +" --> "\t"
(Edit manually additional errors on tab if there are still some left)
save as mylog.tsv
open in Excel, and use table of labels as needed.