i currently have the row background colour set with expression that is;
=IIF(ROWNUMBER(NOTHING) MOD 2,"White","Silver")
However on some rows it seems that colour is not alternating and staying the same like the image below. Does any one know why this may be happening
The expression itself is fine, it's the scope that's the problem. The ROWNUMBER function gives different results based on which groups it's in within your matrix. You are currently using Nothing as the argument which tells it to use the default scope. You will need to look into overriding that with the correct group name so that the row numbers are calculated relative to the scope you actually want.
Related
My company has reporting standards that require the lines of a table to alternate in color for readability purposes. I know how to do that, however the latest report that I am working on has conditional visibility on each line.
What happens is that the alternating background color gets applied to the table before the visibility condition gets checked, leaving a the report with no pattern of background color to speak of.
I have searched for any kind of setting to change when certain property expressions get applied to a table. There doesn't seem to be one.
Any assistance would be greatly appreciated!
This article deals with the RowNumber function in SSRS. It contains an example of alternating row colors in the Tablix.
https://learn.microsoft.com/en-us/sql/reporting-services/report-design/report-builder-functions-rownumber-function?view=sql-server-ver15
=IIF(RowNumber("GroupbyCategory") Mod 2, "White", "PaleGreen")
I found the solution here:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/8365ca9b-7a50-4024-a706-4516ed12c038/how-to-maintain-alternating-row-background-colors-while-making-blank-rows-invisible?forum=sqlreportingservices
Instead of applying the formatting across all rows, I only apply it using the same visibility conditions that hides the rows in question. The example in the link uses blank rows where I will use some extra logic instead.
I am developing a multi-grouped report. Base on the level of a group, I am to set the bottom border width to 2pt else 1pt. I only know how to set the default for all groups. I have googled and tried various expressions but unable to get around the requirement.
An example of what I want to achieve is shown in the image below
I would imagine you could evaluate the scope on a group and set a row(s) bottom border accordingly.
If you right-click a row I assume you could apply the following in an expression:
<For the Border.BorderWidth.Bottom property of the detail or row group>
=IIF(Level("MyGroup")=0,"1pt","2pt")
The answer by Ross Bush seems to be correct. Though I would use Choose as it gives more options should you need more width.
I've used 10pt and 20pt so the difference is easily visible for this example.
I've asked a similar question recently (See below) however I'm now struggling with a similar scenario.
I have a cell with an expression which is a formula to calculate a % difference, and then depending on the value the percentage difference, I want the cell to change colour. if it's over 1% red, if it's under 1%, green.
The current expression which works to calculate the percentage is;
=(Sum(Fields!P1RateAmount.Value) - Sum(Fields!P1Amount.Value)) / (SUM(Fields!P1Amount.Value)) * 100
I'm presuming I need to wrap a IIF around it, but when I have tried it hasn't worked
If anyone could help me with this I'd be very grateful
Also for context, the formula can't be done in SQL to get a number as I'm using collapsing columns and the percentage formula I'm using in SQL brings back the first row when used within SSRS, and doesn't take into account the full sum
Previous Question asked as referred to above
The expression for the BackgroundColor property of your text box would be:
=IIF( (Sum(Fields!P1RateAmount.Value) - Sum(Fields!P1Amount.Value)) / SUM(Fields!P1Amount.Value) * 100 > 1, "#fff5fa", "MintCream")
I prefer a light shade of green or red but you can substitute the colors with Red and Green if you want to hit them over the head with it.
Just for anyone who may be looking at something similar, the following worked for me
=Switch(
me.value <=-1 OR me.value >=1, "Red"
,me.value >-1 OR me.value <1, "Green"
)
I think this is because the cell already had an expression of
=(Sum(Fields!P1RateAmount.Value) - Sum(Fields!P1Amount.Value)) / (SUM(Fields!P1Amount.Value)) * 100
to get number, the 'IIF' and then referencing the cells wouldn't work. However me.value would look at the value of the cell rather than working the formula, thus bringing back the desired colour
I have a basic Tablix in my report that currently renders as follows:
These are steps in a manufacturing process with the clock number of the person who performed them with date performed in the last two columns. However, sometimes steps are combined and performed together. In the example above, steps 10-20 are performed together, and 30-40 are performed together. So I would really like the report to be rendered like this:
I do have a column in my data called "StepRange" which in the above example would be "10-20" for the first two rows and "30-40" for the third and fourth rows. So when the value of StepRange is alike, I know those rows are performed together and henceforth the last two columns should be combined. My example shows only two rows being combined at a time, but it could be any number.
How can I make my report look like the second example above instead of the first?
Single Tablix Method
Rather than literal conditional merging, you can set the border style of a textbox using an expression to achieve a similar effect. There are a few steps, but none of them are particularly involved.
Create a parent group for StepRange. Do not add a header or footer, and delete the added column without removing the group.
Make sure that your properties panel is visible on the right of your screen. If not, check the "Properties" checkbox under the View ribbon.
Click on your first detail TextBox and expand the "BorderStyle" property. Set the "Top" property to the following expression:
=IIF(RunningValue(Field!Step.Value,CountDistinct,"StepRange")>1, "None", "Solid")
Set the Bottom property to "None".
Set the expression of the detail TextBox itself.
Replace FIELDNAME with the appropriate field:
=IIF(RunningValue(Field!Step.Value,CountDistinct,"StepRange")>1, "", Field!FIELDNAME.Value)
Repeat this process for each detail TextBox.
You may need to create a dummy row at the bottom with a black top border if you do not have a summation row. (optional)
The expression only evaluates to "Solid" for the first Step value within each StepRange group, so subsequent rows do not have a top border and appear undivided.
Nested Tablix Method
Using a nested Tablix is more straightforward. I have had some issues with them, including some rendering hiccups. But in a report this simple that may not be an issue at all.
Set up your main Tablix to group on StepRange.
Either clear or add a column to the left for the individual steps.
Select "Insert Table" from the toolbar and click on the empty cell.
Set the cells to your step and operation fields and delete the extra column.
The result should look roughly like this:
By default the inner Tablix will be detail grouped. If your detail rows are more granular than the "Step" field, go to the properties of the "(Detail)" group and add a Group Expression for Step.
You can also delete the inner header row if you don't want to see it repeated in the report.
This results in the employee fields actually being merged and spacing properly. If you don't use an aggregate function on those fields, their value will be that of the first row returned internally. Which is moot if their values are uniform across steps.
I have searched for a solution but I can't find one suitable on this problem.
I have a chart in access where the Y-axis is text but starts with a number, so up along the y-axis i get this:
I know why, but I don't know how to fix it.
They all have an ID which is fine. I can chose to put the ID on the Y-axis, but then the kW range can't be visualized.
How is this changed?
Changing the text to number is not possible as it needs to be like "a-b kW".
Thanks in advance.
For those who might get this problem, I found out why.
When selecting the data, it chose to use the "Total" function, and "Avg" because that is what the values are. (The picture below says "Group By" but it was automaticly set to "Avg". I just forgot to change it when i snipped for stack.
That results in:
But if i remove the "Total" function i get this:
So, removing the "Total" function works here...
In your query, can you sort by ID, but not display it (e.g., in the query designer, sort 'descending/ascending' on the ID field, but clear the 'display' check box)?
As an aside, I've always had a tough time with Access charts... on my last project, the customer wanted a rather complex bar chart, and I ended-up drawing and resizing rectangle objects to get the look that the customer wanted.