Change background color ONLY for two row at a time
Hi Syed, thanks for yoru reply, here what I get originaly what I want is I did try the above statement but didn't work.
August 25th, 2012 12:17pm

Hi, this code =Iif(RowNumber(Nothing) Mod , "PaleGreen", "White") will change background color for every other row. I want to change background color for every two rows. Any info?
Free Windows Admin Tool Kit Click here and download it now
August 25th, 2012 1:27pm

With a very similar code; just check for less or equal 2: =Iif(RowNumber(Nothing) <= 2, "PaleGreen", "White") Olaf Helper Blog Xing
August 25th, 2012 1:37pm

HI rv ! You may get the desired output using below expression; =IIF(((RunningValue(Fields!YourColumn.Value.ToString,CountDistinct,Nothing) / 2) Mod 2) < 1,"#f6f6f6", "#ffffff") You can specify the above expression on your row and set the Background Color property to above expression. Please let me know if this doesnt work for you. Hope I have answered you correctly. Thanks, Hasham Niaz
Free Windows Admin Tool Kit Click here and download it now
August 25th, 2012 1:58pm

Thank you for both BUT Have a group, child group and details. If I use =IIF(RunningValue(Fields!groupField.Value,CountDistinct, Nothing) MOD 2 = 1, "blue", "red") then it works very well as long as I have only one group of ChildGroup. If I get multiple record for childGroup then entire rows based on the Group color will change. I want to change the code for ChildGroup but does not work =IIF(RunningValue(Fields!ChildGroupField.Value,CountDistinct, Nothing) MOD 2 = 1, "blue", "red") Note: my detail row always going to have two records only.
August 25th, 2012 4:38pm

This works only for the first two rows, what about others? =Iif(RowNumber(Nothing) <= 2, "PaleGreen", "White")
Free Windows Admin Tool Kit Click here and download it now
August 25th, 2012 4:39pm

Hi There Thanks for your posting. I think you might need to change the scope of your running value expression. So instead of putting nothing please try to put scope as your group name =IIF(RunningValue(Fields!ChildGroupField.Value,CountDistinct, "YourGroupName") MOD 2 = 1, "blue", "red") =IIF(RunningValue(Fields!ChildGroupField.Value,CountDistinct, "YourGroupName") MOD 2 = 1, "blue", "red") You can put this expression for every group if you would like to change the colour of every group, please change the scope according to your need(Your group name) I hope this will help If you have any questions please let me know Many Thanks Syed Qazafi Anjum Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.
August 25th, 2012 5:39pm

Hi Rv7a99cv, According to your description, you want alternate row color in your tablix, right? If you use a table in your report, you can use RowNumber function to alternate row color. Use the expression below to set the background color: =iif((rownumber(nothing)-1) mod 4 >1,"White","Silver") If you use a matrix in your report, the RowNumber function in the Matrix is totally different with it in the table because you are always dealing with grouped data in a matrix. In this case, please refer to the steps below to alternate row color. Add the custom code below to your report: dim Counter as integer=0 Public function getCounter() as Integer Counter=Counter+1 return Counter end functionAdd a column to the right of the matrix, type the expression below to inserted column: =code.getCounterChange the text-box name to rownumber and set the visibility of inserted column to Hidden.Use the expression below to set the background color: =iif((reportitems!Textbox32.Value-1) mod 4 > 1,"White","Silver") The report looks like below: If you have any questions, please feel free to ask. Regards, Charlie Liao
Free Windows Admin Tool Kit Click here and download it now
August 26th, 2012 12:45am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics