SSRS 2005: Dynamic Background Color for Cells, Excluding Subtotal Cells - sql-server-2005

I have an expression in place in my report to change the cell color if the value of the cell is above a certain threshold. It's just an expression setup in my text box called "percent" - on the background color property. Looks like this:
=IIf((FormatPercent(Sum(Fields!items.Value)/First(Fields!totalItems.Value),2) >= .04 & "%"
And First(Fields!errorCodeAdjType.Value) = "Error1")
Or (FormatPercent(Sum(Fields!items.Value)/First(Fields!totalItems.Value),2) >= .02 & "%"
And First(Fields!errorCodeAdjType.Value) = "Error2")
,
"Maroon", "Transparent")
It works as I want it to; however, it is also changing color of my subtotal cells. How can i write this better to make sure it doesn't think that one of my subtotal cells meets the cell color criteria? Thanks!

You can set the background property individually for different cells. Sounds like you've defined this for multiple cells. Clear the BackgroundColor property for the cells that are in the subtotal row.
If you don't have a separate subtotal row defined in the report, then you'll need to add a condition that can distinguish subtotal rows from detail rows. I strongly recommend that you create the subtotals by using SSRS groups, not as subtotal rows included in the query. That is, avoid WITH ROLLUP.

Related

Conditional formatting based on formula addressing current row in LibreOffice Calc

I have a column of cells in LibreOffice Calc with conditional formatting to apply a style to those cells.
The conditional formatting is programmed to format the cell if the following formula is true:
AND(B106=0,C106=0)
The trick is that instead of always evaluating this formula for row #106, I would like to evaluate the formula for the current row.
For example, in cell A1, I would like the conditional formula to be
AND(B1=0,C1=0)
And in cell A2, I would like the conditional formula to be
AND(B2=0,C2=0)
What I'm looking for is to program the entire column with a conditional formula like
AND(BCURRENTROW()=0,CCURRENTROW()=0)
but obviously that syntax is incorrect.
How can I accomplish this?
A conditional formatting based on a formula has two settings that determines where and how it applies.
First is the Cell Range to which it applies to. If this is
Range : A1:A1048576
then it applies to the whole column A.
Second is the formula itself. Precisely whether cell ranges in that formula are relative or absolute or mixed. As in all other formulas, a relative cell reference is A1 for example. A absolute cell reference is $A$1 for example. And mixed cell references could be $A1, where column A is absolute but row is relative, or A$1, where column is relative but row 1 is absolute.
So a conditional formatting applied to range A1:A1048576 and having formula AND($B1=0,$C1=0) should fulfilling your requirement. As you see the formula always gets columns B and C (absolute) but gets the row in which it is actually calculated (relative).
Example:
If you want to paint all row with a color when the column "B" CONTAINS a value, for example "XXX" you can do this:
Format-> Conditional Formatting (Add)
We select "formula" and we put:
SEARCH("XXX";$B2)>=0
We apply the style "Good" (To view selected rows in green)
And we select the matrix in we want actuate (important!), by example :
A2:H109
Now we see all the rows where the column B contains "XXX" in green.
enjoy !

Change the color of x number of cells based on the numeric value from another cell (in multiple rows)

My question is basically the same as this one (Change the color of x number of cells based on the numeric value from another cell) with one extra condition: for multiple rows.
enter image description here
So on the left side, there's a column "PTO 2018 Total" (range= I3:I80) and I want to color each row (range= J3:S80) based on the number of the column I, like I manually did for the first two rows.
Thank you so much in advance.
Use conditional formatting:
Use a formula rule with the formula:
=AND(COLUMNS($J1:J1)<=$I1,ISNUMBER($I1))
Applied to
=$J:$S

How to write the condition in SSRS for dynamically changing color of the cell based on value

How to write the condition in SSRS for dynamically changing color of the cell based on value
https://i.stack.imgur.com/2XHL4.png
try something like this:
=IIf((Fields!nbday.Value >= 0 and Fields!nbday.Value < 90) ,"#3174c3",IIf((Fields!nbday.Value >= 90 and Fields!nbday.Value < 120),"#02C1D3","No Color"))
Choose the Cell / Row / Column that you want to Change the color dynamically
Go to Properties (Hit F4)
Select Back Ground Color and Choose Expression
In the provided window, Give your Expression based on which the color will change.
Refer This Link for more details

Alternate Cell Color in a column B for particular range say B67 to B323

I need to color alternate cells in a column in Excel via vb,basically requirement is if B1 value is selected like4/6/8/10/12 a table gets generated (done) and then with a particular pattern cells should be colored.I have done manually for few of them but requirement is to color alternate cells from B67:B323 in a column B.
There's no need for VBA for this. Use conditional formatting instead.
=MOD(ROW(),2)=0
MOD(ROW(),2) will return 1 for odd numbered rows, and 0 for even.

Dynamic background color for total cell

I'm using Pentaho Report Designer and I would like to change the background of the cell that contains the sum of all the measure values of a column based on the calculated value. For the measure values, this can be easily done defining a formula for the background property like the following one:
=IF([measure] >10; "red"; "green")
However, from the cell that shows the total, [measure] is always null.
How can I get the value of the cell (or the result of sum all the measure values)?
Thanks
Finally I've found how to do this. It is necessary to create a function to sum the values so it can be referenced later from a formula:
Create a function to calculate the total (Add Function... > Summary > Sum)
Inside the properties table, select Field Name for the function. Give it a Function Name to make reference to the formula later (i.e. budgetTotal)
Use the function to apply the conditional formatting based on its value (i.e. =IF([budgetTotal] >10; "red"; "green"))