Link to home
Start Free TrialLog in
Avatar of Zolf
ZolfFlag for United Arab Emirates

asked on

SSRS - Change colour of row based on column value

Hi there,

I want to change the colour of the rows based on the value of column(receipt no.). How can I do this. Please see screenshot.

User generated image
Avatar of Arifhusen Ansari
Arifhusen Ansari
Flag of India image

Do you have mapping of Receipt Number to Color ??


Avatar of Zolf

ASKER

Thanks for your comments

No I do not have anything specific to map it.

I tried something like this, but not what I want 

=IIf(Fields!receiptno.Value = Previous(Fields!receiptno.Value), Nothing, Fields!receiptno.Value)

Open in new window

How you decide which color for which receipt ??



I am not sure whether this is correct solution. But what you can do it go to text box property and click on Fill go to expression and define the color expression. Sample is shown in screenshot. Also refer the rdl file attached. You can just change DB Connection. ChageRowColor.rdl

User generated image
Avatar of Zolf

ASKER

Thanks for your comments.

How you decide which color for which receipt ??
I need to check when the next receipt number starts or when the first receipt number ends. Then accordingly change the colour.

I tried with this expression, please see screenshot

=IIF(RUNNINGVALUE(Fields!receiptno.Value, COUNTDISTINCT,"detailproductandrawmaterialtransaction") MOD 2 = 0,"Yellow","White")

Open in new window


User generated image
ASKER CERTIFIED SOLUTION
Avatar of Arifhusen Ansari
Arifhusen Ansari
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zolf

ASKER

I just noticed in the end of the report page 72, the report is not changing colour when the receipt no. changes.

User generated image
Avatar of Zolf

ASKER

I have added another expression for the receiptno. this time not in the textbox properties fill BUT in the expression itself of the table column for receipt no
=IIf(Fields!receiptno.Value = Previous(Fields!receiptno.Value), Nothing, Fields!receiptno.Value)

Open in new window


What it does is it removes the receipt no to repeat itself and just show once. This works properly. see screenshot for exactly the same place where I pointed to the issue above of not changing colour.

User generated image
You are not getting result as expected because you might have same Receipt number in other page. Hence your distinct count is not changing. Due to that your color is not changing. You can see in below example.
804 is already there in the data so color didn't change.

User generated image
Avatar of Zolf

ASKER

Thanks for your comments. Any solution to this issue??
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zolf

ASKER

thanks a lot!!