I am trying to change the background color of every odd numbered record of each group in my SSRS report.
I know this will change the color of every even numbered record in the report.
=IIF(RowNumber(Nothing) Mod 2, "No Color", "Silver")
This will change the first record of each group. =IIF(Fields!EvaluatorID.Value=previous(Fields!EvaluatorID.Value), "No Color", "Silver")
It seems like combining them in an OR should do the trick. =IIF((Fields!EvaluatorID.Value=previous(Fields!EvaluatorID.Value)) or (RowNumber(Nothing) Mod 1), "No Color", "Silver")
But the color is not changing when there are 3 records in a group. Does anyone have suggestions on how to change the expression?
Just use this...
=IIF(RowNumber("myRowGroupName") Mod 2, "Silver", Nothing)
You need to specify the row group name (case sensitive and enclosed on double quotes). This evaluates rownumber() within in each group so it will start at 1 again.
Then to flip odd and even highlighting, reverse the colours that are applied. I've also used Nothing as this is the actual default value used in SSRS, "No Color" is just a user friendly name shown in the properties window.
Related
With SSRS how can I modify this table so the last "Line Amount" value with a repeated "Invoice Number" gets modified with the diference between "LineAmount" total and "Invoice Amount Total".
In the example, the SUM of all Line Amount values is 1574,47
I want the last value (22,77) to be 439,54, which is
Invoice Amount total - SUM(Line Amount)
2014,01 - 1574,47
And this should be done with evert block that had a repeated "Invoice Number".
Is this possible?
If there's a way to do it directly with SQL Server (which I think its even more complicated) would be ok too.
If you set up your tablix with a row group grouping on the Invoice Number, you can add a "total" row before or after the individual line item entries. You can do this by right clicking on the row group, then Add Total, then select before or after (in your case, you would want after). In the new row, you can then create an expression in the column where you would like to see the difference.
You wouldn't be able to have this replace the last row (at least not to my knowledge), so you would still have 22,77 showing. But it should get you closer to what you're looking for.
I'm not sure exactly how your dataset is structured, so your exact expression for the difference might be slightly different than this example. If the Invoice Amount is only contained on one row for that invoice number, then your expression would just look something like this:
=SUM(Fields!InvoiceAmount.Value) - SUM(Fields!LineAmount.Value)
These are my query results:
But I want to merge the MemberName column when the member is the same. But the values in the other columns still need to display separately. How can I make my report use the following format?
Create a Group for SIno at the lowest level, if you don't have one already. Suppress the header and footer of this group.
Then add this formula to the suppression logic for SIno, Member Name, and Sanity Code:
{SIno} = PREVIOUS({SIno})
After discussing your needs in the comments, I recommend the following: Set your report such that it doesn't have any borders, and instead have the background color alternate between white and gray. Group based on SIno if you haven't already, and set the background color to:
IF GROUPNUMBER MOD 2 = 0 THEN crWhite else crSilver
I do this all the time with my reports. It looks professional, and the customers understand it:
I have a datawindow with 3 columns. I want to somehow inform the user that the value of a column is available 5 days from today. Like a countdown. After those 5 days the column takes the default value. Is that possible?
Use data window expressions!
They can be used via the datawindow painter and allow very fine control on the display without the burden of programming. More specifically, in this case, I suppose you have a column 'expiry' to specify the maximum period of availability.
In the datawindow painter, click on the column for which you want something to happen. In the 'Background' tab, put
Gradient: horizontal
Color: Red
Spread: expression (see the little box on the right?)
'spread' can have a value from 0 to 100, so compute an expression to go from 0 to 100 depending on the number of remaining days:
100 -((5 - if(daysafter( expiry , today ) < 5, daysafter( expiry , today() ), 5 ))* 20)
With this, the 'red' background color will spread more or less depending on the number of days remaining.
Other possibility: use the 'Tooltip' tab, enable the tooltip (first field) and put as message: 'You have ' + string (daysafter(expiry, today()) + ' days left to modify this field'
This will show a message (variable with the line) everytime you pass with the mouse on the field.
Once you get the trick, you can play around and have your own ideas using these datawindow expressions.
I need some help figuring out how to accurately display the labels in a stacked chart in SSRS; I need a single represenation of the upper stack in the below chart.
The chart itself has two states, it can either be based on red or green data, both are in the same data source.
At the moment the chart looks like this (this is based on green data):
As you can clearly see both the labels inside the chart and the legend is absolutely cluttered. The idea is to have a legend where we have two items (Late issues and Not finished issues); one that displays any non-finished issues and one that displays any non-finished issues that are outside the estimated due-date.
For reference: The above chart should have 1 non-outstanding issue and 5 outstanding issues (3 Ongoing and 2 Open, see below for further info about stages).
Inside the chart we want to have a numerical respresentation of above requirements. Basically a number representing the outstanding issues and one that shows any non-finished issues.
This is what a red representation looks like:
At this point I'm not sure what could be wrong anymore. As mentioned they both run on the same dataset, but with slightly different values.
The red tracker has a simple True/False value that it runs most of its data from whereas the green tracker has a numerical representation of three values (5-7). Where the data it represent is: 5 - Open, 6 - Ongoing, 7 - Closed.
I've attempted to only get the green data both when the series is either of the three above mentioned numbers, but also when it's only getting anything that is un-closed (5,6 but not 7).
This is the code to set the labels for the maroon part of the chart (it's only a workable snippet.):
IIF(Count(IIF(Fields!Outstanding.Value = 1 AND
Fields!TRK_TrackerStatus_LKID2.Value <> 7, 1, Nothing)) = 0, "",
Count(IIF(Fields!Outstanding.Value = 1 AND
Fields!TRK_TrackerStatus_LKID2.Value <> 7, 1, Nothing))))
Basically what it does is checking if there are more than 0 items that are outstanding and that aren't finished (are not 7). If there are more than 0, it sets the label. If there are 0 counted items, the label should be the empty string.
I think what you are wanting to do is group your Series data based on a status number. You can either do this as a case statement in your dataset query or you can use an expression in your Series Group:
The expression I have used there is as follows:
=switch(Fields!Status.Value = 5, "Group 1", Fields!Status.Value = 6, "Group 2", Fields!Status.Value = 7, "Group 2", TRUE, "Group 3")
This esentially assigns a grouping value to your data based on the values in the field. In this case, a Status of 5 becomes Group 1, a Status of 6 or 7 becomes Group 2 and all other values become Group 3 just to ensure bad data is obvious on the report.
What this does is takes the chart as it would be displayed with the raw data (On the left) and turns it into what I think is how you want to see it (On the right):
You will need to apply the same logic to your chart labels as well. For this reason I would recommend you add a column to your original SQL script that does this grouping for you, so you only have to make changes once.
In SSRS report, I want to perform conditional color formatting where highest rank should be Green and lowest rank should be Red within a Regional Manager group as shown below
Note: Couple of options, I was thinking of includes
I am using custom code function, for deriving Min and Max value, and somehow if I can include grouping filter on Regional Manger then it could work, but don't know if that's possible
In dataset, I create extra columns for each column and store Min\max value in it. But less keen towards this option, since I have 24 different ranks and which would mean, I will need 24 different columns along with current 40 attributes
Any help would be appreciated
I know you don't want to do this for each column, but despite your misgivings it is probably the best approach. Based on my previous answer to your earlier related question you can colour the min and max for each group as follows.
Create a table with fields store, atvrank, and btvrank
Right click the row header, and select Add Group -> Row Group - Parent Group, and choose Regional Manager. Set the Group name to RegionalManagerGroup
Then set the background colour for your cells to
=iif(Fields!atvRank.Value = min(Fields!atvRank.Value, "RegionalManagerGroup"),
"Green",
iif(Fields!atvRank.Value = max(Fields!atvRank.Value, "RegionalManagerGroup"),
"Red",
"White"
)
)
This now finds the maximum and minimum within the current group instead of the whole dataset. You will need to set this expression for each field individually, but this is probably less effort than returning new rows from the database to determine the maximum and minimum for each field.
This approach will give the following output
Please seriously consider this solution. If you have further questions, please just ask.