Avatar of vcharles
vcharles
 asked on

How to change odd rows color in detail section of MS Report

Hello,

I am using MS Reports with VS 2008 (VB.NET), created an .rdlc to run my reports, but would like to change the backgroud color of alternating rows, can that be done in MS Report? I don't see such properties.

Thanks,

Victor
SSRSVisual Basic.NET

Avatar of undefined
Last Comment
vcharles

8/22/2022 - Mon
Nasir Razzaq

sammySeltzer

It is very simple.

If you click on the field,
click on properties to your right,
click on background color,
select expression.

Then enter something like this:

=IIf(RowNumber(Nothing) Mod 2 = 0, "Transparent", "gainsboro")

Replace transparent and gainsboro with your own favorite colors.
macksm

From what I know About MS report. it's just a report viewer. To create A report or change You require one of the microsoft database applications. Either access or SQL server
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
vcharles

ASKER
Thanks, but I tried the suggestions in the links but it still doesn't work. Do you have another source I can look into?

Victor
ASKER CERTIFIED SOLUTION
sammySeltzer

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Nasir Razzaq

Did you try all the different approaches in the link?
vcharles

ASKER
Thanks for the snapshot, It's hard to see itt because it is not very clear, but when I enter the code you provided, the background color of the entie table becomes (Red) the color of my second "color" variable. I would like it the be red only when the row is an even number and silver when the row is an odd number. Below is the code in the properties windows for Background color of the table object.

= IFF (RowNumber(Nothing) Mod 2 = 0, "Silver", "Red")

Thanks,

Victor
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
vcharles

ASKER
I didn't try the vbscript approach.
sammySeltzer

Did you click the screenshot to open it?

Opening it makes it bigger and easier to see.

Just follow it and you click on the same box that I click on and you get same result.
vcharles

ASKER
We are getting closer, It works for a partricular column but I need to work for  all the columns in the even or odd rows. Thanks.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Nasir Razzaq

I think this is field specific so you have to perform this for each column.
sammySeltzer

Yes, that is true. In othe words, go through each column to use same expression.
vcharles

ASKER
Got it. Thanks.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
vcharles

ASKER
Thank You!