How do alternate row colors in an SSRS 2008 report? - ssrs-2008

I'm trying to alternate row colors in one of my reports. So following some advice from the web, I've tried putting something like this for the background color of the rows in question:
=IIF(RowNumber('manager') Mod 2, "LightBlue","White")
Where manager is the name of my row group.
But what this does is make the color alternate every time a value is present. And some of the rows that aren't even supposed to be colored get colored. I really don't get it, but perhaps the fact that there's a column group is messing things up somehow?
I've also tried numbering each row in my query and going off that but I still get the same weirdness.
And I even tried returning the color in my query and it gets even stranger because then every single row is colored Light blue, and again even the ones that aren't supposed to get colored. Just Visual Studio being buggy as always I suppose?

RowNumber('manager') resets to 1 when you get a break in the manager group. So rows under that manager may toggle.
=IIF(RowNumber(Nothing) Mod 2=0, "LightBlue","White") seems to work OK with Nothing in the group.
As you said, you can also number each row in the result set (identity column?). Then you want to check the value of your numbered column rather than use the RowNumber function.
=IIF(Fields!id.Value Mod 2 = 0, "LightBlue","White")

Related

Repeating a result on a line on the rows/lines below untill that result changes?

Image showing problem
I want to know if there is a way of repeating the result of a column downwards until the change of result.
Attached image shows the problem.
I need 9.1stWC column to fill the number(which is actually a string) all the way down until that number changes.
The column is not null where the blank fields are (9.is null, shows this) so I'm going to have to write additional formulas to show I'm guessing.
I've used previous function but that only shows for the next line down then is blank after.
The replicate string function will go across the column not downwards.
I've looked at a stringVar but cant find a way of making this work on this report.
I'm reserved about grouping as I have a lot of other filters and by grouping I could possibly loose the sequence depending on what I group by.
My aim is to show WC which are equal to the current op line by doing a simple formula after I have managed to populate that column
I will assume your column is a field named {Result.WC}.
Try this:
Create a formula. Let's call it #LastWC.
Use this code in the formula:
shared stringvar sharedLastWC;
if not isnull({Result.WC}) and {Result.WC} <> "" then sharedLastWC := {Result.WC};
sharedLastWC; //returns
Replace the field by the formula.
The idea behind this is to set the shared variable when the field is not blank and not null. So, the variable will hold the last "filled" value.
I can't make a test with the purposed solution right now, but give it a try and make adjusts if you need. Tell me if it does not work.
If the first row can be empty, you may need to create an aditional formula do start the value of the shared variable in the header of the report.

Display static, non-repeating text in Details Section

I need the gray box in my report to print in the Details section to the right of the actual details:
The defect code box is a subreport that serves as a key to various defects that pop up in the details. How do I get it to appear on the right without increasing the height of the Detail section, and such that the gray box does not repeat.
There's a few ways to do this, but due to the nature of Crystal Reports it might be difficult to pull off.
I'd recommend placing the white table on the left into its own subreport. Then you just arrange the subreports so one is on the right and one is on the left. That's probably the least amount of work.
If that's not an option, you could in theory turn the gray box into a very weird, very specific formula. (Not recommended, but still doable.)
You'd write this formula to contain a large if-else statement based on the record number. (If it's the first record, the report displays "DEFECT CODE". If it's the second record, display "SI - SLAG INCLUSION" and so on and so forth. Change the background color of the formula to gray, and suppress it if the record number goes past the final line.
Again, I don't recommend this last suggestion, but if you absolutely can't put the white table into a subreport you can get this to work with a little elbow grease.

Background Color Not Filling in Entire Row Based off Expression in SSRS

I was hoping I could get some help on this issue. Got a report that displays data for events; of which we have two types: fixed and mobile.
To fill in the row based off what type the event is, I used this expression:
=IIF(Fields!OwnerType.Value = "Fixed", "LightSteelBlue", "#FFFFFF")
But here is what the result actually look like:
The rows with the light blue background color are fixed sites are often not assigned incentives/promotions. And if they aren't, I would still like the entire row to have a background color of light blue.
My issue like in the fact that the incentive columns (Sam's Club, T-Shirts, Wal-Mart, etc) are created dynamically through a column grouping - I have no which values might appear here or how many.
The way I have it configured currently is to put an expression on the cell itself:
But it leaves me with my reason for posting, I can't get the entire row to be back filled with this column grouping.
And if I apply the expression =IIF(Fields!OwnerType.Value = "Fixed", "LightSteelBlue", "#FFFFFF") to the column grouping the same way I did for the row, it will only change the colors of the individual cells where the incentive is and the header.
Under Group Columns -> Incentives Properties, can I change the visibility to also include the background color fill?
Added this expression for the row:
=Iif(
Max(
Iif( Fields!OwnerType.Value = "Fixed", 1, 0 )
, "Row_Group_Name"
) = 0
,"White"
,"LightSteelBlue")
Which filled in the entire row.

How to color code cells of a column based on the text value in Tableau

I'm a new tableau developer trying to develop a table based tableau report. I have a column in the table called "Status" which essentially contains 3 values "In progress" , "Blocked" and "Completed". I want to color code the cells of this column based on these text values. I was unable to get this from the tableau community and hence posting it here. Anyone faced this problem? Kindly let me know how you solved it.
Raghu
First thing, Tableau is not excel. Stop trying to make Tableau work like excel, you'll miss most of the power Tableau brings, and make it inefficiently operate like Excel.
That being said, let me give you an alternative. Instead of text chart (which is what you're using to get a table), select Shape chart. This will add balls in the last column (but you can choose what shape you want)
Now drag the Status to color, and voilĂ , the balls are painted accordingly to Status. You can customize the shapes too (just drag some field to Shape), and selected what shape and color you want to each value.
This will look more like a "control panel", with the color of the balls something like a traffic light. You can even import some pictures of traffic lights and use them as shapes, that could be cool (if properly used)
I know this post is a couple years old, but there is a way to do this. In a new tableau workbook, import the data from Excel (just one column with the status values). Rename the table to "Status Colors" with a dimension field called "Status". Click the dimension field "Status" and select Default Properties > Colors. Assign the colors to each data item (value). For custom colors (RGB, HTML, etc.) double-click the color next to the value and assign the desired color. Click OK, then publish the data source to the server with the options checked to "Include external files".
You now have a Tableau data source that can be added as data to any other workbooks that when linked, the [Status Colors].[Status] can be used as the color key for the field on any graphs. The default colors are stored in the data source. If you update the color workbook, then it will update any other workbooks that use this data source.
Since SO community has thrown it in active threads, let me propose an answer. Though, I completely agree that we shouldn't replicate features of excel in Tableau, yet here is one workaround.
I took a dummy data like this
create a calculated field say status cf with the following calculation
CASE [Status]
WHEN 'In Progress' THEN 'Yellow'
WHEN 'Completed' then 'Green'
WHEN 'Blocked' then 'Red'
END
create two more CFs say 1 and 0 with just 1 and 0 in these as calculations.
Drag dummy and status to rows shelf. sum(0) and sum(1) to columns shelf.
Drag status cf to sum(0). Edit sum(0) in marks card with type as shape (square), and increase its size. edit colors as fixed in calculation.
Drag status to label in sum(1) in marks card. change type to text
Convert both measures in columns shelf as dual axis.
After a little formatting, you'll get a text table like this
You may optionally hide, status col in rows shelf

SSRS 2008 Column Visability

I'm currently getting used to working with SSRS 2008 as I previously used 2005. I have a data table set up with various columns and rows ect, one of the columns is a calculation of 3 of the others that need to be expandable to be viewed as a breakdown.
I've set to column vis by the group field which is fine, however it doesnt move the columns next to it in or out, it stays in the same place no matter how the toggle is set so i end up with a gap between columns. It seemed to do it automatically on 2005.
I cant find the setting that stops these columns being fixed in place.
Don't use the Visibility option in the Properties section. Right-click on the column handle at the top and go into Column Visibility. Set it to Hide in there.