Color a row based on condition in Interactive report in Oracle Apex 5 - oracle-apex-5

I wanted to color the complete row based on some criteria. My query looks like this:
select QUIZ_ID,
QUIZ_NAME,
QUIZ_TOTAL_SCORE,
QUIZ_MINIMUM_SCORE,
START_DATE,
END_DATE,
ACTIVE_FLAG
from QUIZ;
When the ACTIVE_FLAG value = 'Y' then I want the row to be colored. I have used a technique which I found somewhere but it is not what I am looking for. It has colored the text not complete cell (shown below). But I want complete cell to be colored.

If you are using an Interactive Report instead of classic report, you have that ability via the "Actions" button/menu, "Format" option, "Highlight" option, where you can enter your criteria and what colors you want for foreground (text), and background, and whether to highlight the cell or whole row.

Related

Color a specific range of cells in the same row

Similar to a Gantt Chart but not quite the same, I'm trying to color a variable range of cells on the same row.
As you can see I have a variable number of tasks and a variable start and end for each task
I've created a simple time series where the "Machine 1", which is in the row number 6, is making all the tasks. The time series is in the row number 3.
So basically, I need to color the ranges given by the tasks table in the Machine 1 row, using that time series as a reference to start coloring the cells. Each task has to have a different color.
As I'm a beginner in VBA, I've been trying to do this using a formula:
=IF(AND($C4<=AK$3;$D4>=AK$3);1;0)
Being C4 the start of the task, AK3 the place of the time series right now, and D4 the end of the task. Then I would fill the whole Machine 1 row. This would give a 1 in the range of the task and a 0 before and after the task, then I could format the row and color the cell by the given value in each cell. (1 color and 0 blank)
The problem is that this only works for one task and I really don't know how to change the formula to add the other tasks. I'm pretty sure this can be done in VBA but, like I said, I'm still a beginner. Please help me
The final answer should look like this. The color doesn't matter, it's how to color the variable ranges automatically the problem
If I understand what you want correctly, this can be done with conditional formatting:
Use four conditions, one for each of the following formulas:
=COLUMN(AK6)<=$D$7+37
=COLUMN(AK6)<=$D$6+37
=COLUMN(AK6)<=$D$5+37
=COLUMN(AK6)<=$D$4+37
and apply them in that order to $AK$6:$BZ$6

Excel Conditional Formatting - Multiple Rules/Rows

enter image description hereI am creating a table with a schedule events over the course of a year. There are three repeating events, and I would like to highlight the entire row of each repeating event in a different color. I thought that would be a useful thing to do for planning purposes in any sort of schedule or calendar.
So, for instance:
If Event 1, highlight table row in green
If Event 2, highlight table row in orange
If Event 3, highlight table row in blue
I have successfully created a rule for each of them that highlights the individual cell in the desired color, but it does not highlight the entire row within the table. I have also successfully created a rule that will highlight the entire row of the table for one event.
However, I cannot get multiple rules that highlight entire table rows to work concurrently.
Is Excel 2016 capable of doing this?
Thank you in advance for your help!
Edit: Addition of sample formula and screenshot. Thank you Alan!
Sample formula: =$E101="Event 1"
Yes, it is possible to apply multiple rules in the manner you describe.
You haven't posted samples of the rules, nor a screenshot, so I can't comment on why it isn't working for you.
Inside, here is a mock-up showing you a working row-based multi-layered conditional formatting.
Note that how you are aligning your events is important - if you can have event collisions (i.e. more than one event on the same row), then you will need to decide how to handle the collision (e.g. order of priority or add additional rules for mixed colours).
Update based on added details:
Your schedule with conditional formatting applied:
The rules:
Note: If you apply the rules and they don't immediately show up correctly, check the rules. When I entered these, Excel would corrupt the formula and I had to reenter them.
Also note the $E to lock the formula to the Event column.

How to color a cell based on values and date difference in another cell using VBA

Consider I have a Table A in Excel - details as below:
And another Table B as follows
I want out-put as follows,
The Name from Table B has to be checked with Name in Table A, and respective StartDate and EndDate should be picked from Table A and same should be compared with dates in Table B and cell under that name should be colored to green if Status in Table A is in "In Progress" or to Red if in "On hold"
For Example:
Consider Jack in Table B, it has 3 records in Table A, The first start date should be picked i.e 4-Apr-2017 and End date as 27-Apr-2017, and respective coloring has to be done based on status field.
How can I achieve this using VBA/anything in Excel. I'm new to VBA.
Yes you can do it in VBA but I would recommend using conditional formatting (formula) as it doesn't require programming knowledge. To do this, you will need to employ the Vlookup formula.
I believe the output you want is something in the picture link here?
To make conditional formatting, look in the "Home" tab, under Styles -> Conditional Formatting. Highlight the cell you want to format, then select Conditional Formatting -> New Rule. This will cause a new window to pop up. Select "Use a formula to determine which cells to format".
You would want 2 conditional formats.
1.To show green if the date is within the start and end date. To do so, select the first cell in the Gantt chart (cell B8 in example) then enter formula below.
=IF(AND(B$7>=VLOOKUP($A8,$A$2:$D$5,3,FALSE()),B$7<=VLOOKUP($A8,$A$2:$D$5,4,FALSE())),TRUE(),FALSE())
2.To show red when user has item beyond due date, enter formula below with same cell highlighted.
=IF(B$7>VLOOKUP($A8,$A$2:$D$5,4,FALSE()),TRUE(),FALSE())
Once that is done, you can apply the format painter or copy and paste the cell with conditional formatting to extend your table/Gantt chart.
Note that the $ signs are important as they lock the relative reference positions in the formulas. Using the second formula as an example, B$7 refers to the date and you need the reference to be locked to row 7, where all the dates are. On the other hand, the column reference (Column B) can be shifted as you want it to change to with the columns to properly compare against the other dates.
As for multiple items per user, can you expand upon your initial question? Would you like to track based on per user or per item? I am assuming that you're creating a Gantt chart to track a project. In that case, it would make more sense to track specific tasks assigned to people. You can modify the example given to track based on task.

Grouping and colouring each grouping in excel 2013

can you tell me how I can group rows using a value in a specific cell and then highlight the individual groups by alternate colours i.e. one group with white background and one group with a colour in excel? I have macro code which inserts a blank line but I don't know how to colour using macro.
You don't need a macro, just run conditional formatting for values equal to the value of the group you are using.
Here is an excellent guide for how to highlight a row using conditional formatting. It does exactly what you asked for without having to write any code. As you can see it works for multiple rows sharing the common set value.
This is assuming that the only reason you wanted them grouped in the first place was for colouring them together, this method is best if you want to preserve the order of your data.

Changing background color of birt report according to groups

I am generating a BIRT report as shown by image embedded, I am grouping by custmeer such as ACM , AFL etc ...
As you can see I use background alternative color as blue and white, to achieve this I simply use the highlight tab of detail row as(row["__rownum"] % 2 Equal to 0).
now , if I move into more complexity such as different color combination for different groups e.g for group(customer in this case) yellow-white, for group2 red-white etc....
I am using this.getStyle().backgroundColor ='color', but the problem lies into selecting the individual groups, may be some sort of in condition would do the trick, but I am lost
The simplest way to set a row's background colour in BIRT is by adding conditions to the list in the Highlight tab within the Property Editor for the row. It looks as though you have already done this to set alternative lines to blue - by adding extra conditions with additional colours, you can set the background accordingly. This method is most useful where only a small number of colours are required, since you have to set up a different condition for each colour.
Where a larger selection of colours is likely to be required, it would make more sense to do conditional formatting within an event script - you can find an example here.
EDIT: Adding a running group count in BIRT:
Add an aggregation item to your table - you can do this by dragging an aggregation item from the Quick Tools section of the Palette, for example.
In the Aggregation Builder dialog, set the Function to be COUNT, the expression to be 1 and the Aggregate On to be the group you want to count (eg. Customer)
Insert a second aggregation item with the Function set to be RUNNINGCOUNT, the expression to be 1/row[first aggregation name] and the Aggregate On to be Table.
The second aggregation item will be a running count of the groups in the report.