javascript - How to Highlight Specific Column Values based on a CSS Class and Binary Digit On/Off Positions -
using oracle apex v5.1.2.
unsure how tackle following have table called, flag_defs following example data:
id name ------- ------ 1 2 b 3 c 4 d 5 e 6 f based on above table, need display these names report region not on separate lines in following fashion:
a b c d e f where i'm showing 4 names across.
now based on following binary convention, following:
010010 where first 0 lines id = 1 , last 0 in sequence lines id = 6
based on binary sequence, stored within database field in table, need apply class called "flag-red" define color:red;font-weight:bold; names have id position set "1".
so in above example binary sequence, both "b" , "e" receive class of "flag-red" , red/bold within report region. others not.
the same goes removing class if digit "1" reset "0" id.
i need iterate through each digit in field set correct class in report.
i'm assuming firstly create report , assign span class each name unsure if correct approach.
furthermore, javascript better option or stick sql
would appreciate assistance on how tackle above.
i suggest make report in following way:
lets have query returns rows rownum column. adding pivot query can turn following:
select * (select r, mod(rownum, 6) group_no, floor((rownum - 1)/6) row_id (select rownum r dual connect level <= 30) t) pivot(max(r) group_no in (1, 2, 3, 4, 5, 0)) order 1 now can join query table stores binary mask show. lets initial query has columns c1, c2, ... c6with data, , joined table mask data has columns m1, m2, ... m6. (if 1 column mask, can produce 6 columns using calculating expressions) can calculate name of css class in these columns,
select ... case when <expression1> 'flag-red' else 'flad-green' end m1, ... next step go report properties, choose column c1 in column list, go column formatting section, put #m1# in css classes field:
also, mark m1, m2, ... m6 columns hidden.


Comments
Post a Comment