I need to have each record to rotate background fill in SSRS but each record is grouped into two rows, I have tried the solution that others have used but they are not working.
This is the expression I have tried:
=IIf(RowNumber(Nothing) Mod 2 = 0, "Silver", "Transparent")
It seems odd because it looks like its working but about the 6th group down it will put two groups together with the same color. so this needs some sort of adjustment.
Related
I need to make a line chart with the month on horizontal axis and a value on the vertical axis.
I need to colour the line's segments in green if the trend based on the previous month is growing, or in red if the trend is decreasing.
I can't find a way to compare the values grouped by month, and I prefer not to perform this by adding another query from db.
Right-click on the Chart Series (the line of the graph) and select Series Properties..., click Fill on the left then click the fx button to enter and expression for the fill. Let's say your field is called Sales. Use the following expression for the Fill:
=IIF(Fields!Sales.Value >= Previous(Fields!Sales.Value), "Green", "Red")
This worked on my simple test. You may need to aggregate within your query (group by month and sum) for this to work properly.
I have a report with one parent group and an expandable details group. My issue is that I would like the parent cell to have the same background color as that of the details row if any of the details rows has color.
For example:
If I have a parent group of PART ID and details rows that contain columns for location and qty. If any of the qtys are below zero then I have a background color expression to set the qty field for that row to a background color of RED. I need the parent PART ID to also be red if any of the details rows are red.
I can't seem to find a solution to this issue on the web and everything I search only seems to return results about background colors for alternating columns which is not at all what I need. Your assistance is appreciated
There's not any kind of function for this. You would need logic based on how your data and report work. Maybe something like:
=IIF(SUM(IIF(FIELDS!QTY.VALUE < 0, 1, 0)) > 0, "RED", "WHITE")
If any of the QTYs are less than 0, then Red ELSE White.
I'm looking to do banded rows in SSRS.
I've Googled it but only seen examples of it in a table Report not a tablix with multiple groupings.
Lets say I have a dataset
Employee..............Product.........Date...............Amount
Jose..................TV..............2013-12-01.........150
Jose..................TV..............2013-12-02.........100
Jose..................Stereo..........2013-12-01.........50
Jose..................Stereo..........2013-12-04.........100
Jose..................Camera..........2013-12-02.........400
Brad..................TV..............2013-12-03.........100
Brad..................TV..............2013-12-04.........50
Brad..................Stereo..........2013-12-03.........100
Hector................Stereo..........2013-12-04.........50
I want to make a report that looks like
Employee.......Product.......2013-12-01....2013-12-02....2013-12-03....2013-12-04
Brad...........Stereo....................................100
...............TV........................................100............50
Hector.........Stereo...................................................50
Jose...........Camera......................400............................
...............Stereo........50.........................................100
...............TV............150...........100
I wanted to do banded rows.
Let's say
Brad's Stereo line is Blue
Brad's TV line is Green
Hector's Stereo line is blue
Jose's Camera Line is Green
Jose's Stereo Line is Blue
Jose's TV line is Green
The rownumber trick doesn't work because the rows come no particular order
and in the case of Jose's stereo line, the cell under 2013-12-01 and 2013-12-04 would have different values.
I saw a trick using running values and count distinct, but that won't work either.
Anyone have any ideas how to do banded rows in SSRS using a matrix/tablix?
I'm assuming you are starting with a matrix that looks like the image below: two row groups and one column group.
Right click on the row group for Product and choose Add Group -> Child Group. In the Group By box enter "1".
Rename the group to RowColorGroup. Rename the textbox (in the details row to the right of textbox contining the product field) to RowColorGroupTextBox.
Select the value for RowColorGroupTextBox by entering the following as the Value expression: =iif(RunningValue(Fields!Employee.Value & Fields!Product.Value,CountDistinct,Nothing) Mod 2, "LightSteelBlue", "White") (You can change the colors to whatever you want.)
In the textbox properties for RowColorGroupTextBox change the fill color expression to =Value
Remove any text in the header field above RowColorGroupTextBox.
Remove the right border on the textboxes in the column containing RowColorGroupTextBox.
Remove the left border on the textboxes containing the date field and the amount field.
Set the width of the RowColorGroupTextBox to 0 and the CanGrow property to false.
Select the textbox containing the amount fill and set the fill color expression to =ReportItems!RowColorGroupTextbox.Value
This results in a report where the details rows alternate in colors.
Here's a blog post I found that uses the same method.
I have a simple List in my report, with a single row and a single column (which is repeated depending on the number of items returned by the query).
What I'd like to do is this: Inside the cell (in the same location), display one rectangle full of items (text boxes, images, etc) for even rows, and another (with different items) for odd rows.
What is the recommended way to accomplish this?
I would use something like this for the Hidden property of the Rectangles:
=IIf(RowNumber(Nothing) Mod 2 = 0, true, false)
Use a different order for true / false for each of the two Rectangles to get them to alternate.
All the expression is doing is checking if a row number is even and setting the visibility based on this.
This is a pretty standard SSRS pattern which is typically used for alternating row colours, but it should work the same for showing/hiding items.
What i have is a 3 group report, what I want to be able to do is if the sum of textbox145 (which is on group2) is >= make the entire background color DimGrey of group 2. I know how to change the entire row color, however, I am unable to figure out how to do that total of that group based on the data of that groups sum
Thanks!
answered my own question...
=Iif(ReportItems!textbox145.Value >= 10,"DimGrey","Silver")
The Sum function can use a scope argument, so set your background color to:
=IIF(SUM(Fields!FieldNameforTB145.Value, "Group2Name") >= 100, "LightGrey", "Transparent")
The "Group2Name" in there is the magic bit that will give you what you want. This can be set to any parent group name that contains the current data element, but can't be set to a child group. (Which instance would the item use in that case?)