Suppress the duplicate values in group, SSRS Reports - reporting-services

I have an SSRS report
where the date should be grouped by project category
the project code in the category is repeating in side the group how do I suppress the value
Please help me to get an idea.
Thanks,brijit

You can also hide fields by putting an expression in the Hidden property like this:
=Fields!ProductCode.Value = Previous(Fields!ProductCode.Value)
So if the value in the previous record is the same as this one, it will hide the field. You must sort the dataset correctly for this to work. In your case I think the sorting would be Date, ProductCategory, ProductCode.
In the past I used this often together with expressions for field borders to group the output visually.

I think there is one option hide duplicates in properties in ssrs. so you will check in that option under the project category group.so that you can hide the duplicate values and get unique records. first u create one group based on project category in fields properties and then check in that hide duplicate option under that group.whenever you check in that option it will high light one drop down list showing containing group or dataset there you select your created group.

This is a bit late for you brijt, but what I do is edit the textbox properties for that field, in the font tab enter an expression for Color as follows:
=IIf(Fields!ProductCode.Value = Previous(Fields!ProductCode.Value), "White", "Black")
...assuming your background is white this will effectively do what you want.

I think it may be an issue concerning the way you are grouping the dates. Do you have the grouped with time on them as well but suppressing the hours in your output?
For example:
12-5-2010 12:00:00
12-5-2010 13:00:00
if you strip the times off in how you see them but not how you group them, they would show up duped.

Related

Can I use WHERE clause in an SSRS expression?

I saw the post on WHERE clause in SSRS expression. I am also trying to do a where clause, but in a different way. I need to show ItemDesc when ItemId = 4. I set a parameter so that it will always equal 4 for this cell. Now I just need the matching description field. I cannot hard code it because the description may change one day. Is there a way to associate the two fields?
=IIF(Parameters!ItemID_4.Value = 4, Fields!ItemDesc.Value,"")
I am converting from Crystal Reports to SSRS. This first image is the output from CR. I only need to show that ItemDesc in that top left cell.
This next image is from SSRS. It is not limiting the descriptions. It seems to be doing what my expression is saying. ItemID = 4, so display all ItemDesc values but the two fields are not associated right now. I need it to only show the matching value.
Thank you for your help.
I cannot hard code it because the description may change one day.
You are hard coding the parameter anyway by trying to do it that way. I don't think you need a parameter to achieve the result unless you are restricted from adjusting the dataset query.
If you are using an embedded SQL query for your dataset, I would just put a filter in WHERE clause: WHERE ItemID = 4
Another way if you can't adjust the query is to go to Report Data view > Right click on the dataset for your table, "Dataset Properties" > go to the "Filters" tab and add a filter with these settings: Expression = ItemID, Operator = "=", Value = "4" (or "#ItemID" if you want to keep your parameter).

SSRS Group values outside the group

Below is my tablar matrix. with multiple groups.
the result after executing is as follows.
In the highlighted red text box in image (OrganizationId2), I want to see a values as
=OrganizationId /OrganizationId1
when I am trying to copy the expression from OrganizationId and paste it does not allow me as aggregate value is out of the group. I tried ReportItems expression, since i have many recurring rows, this did not work.
Can any one help me in achieving this.?
Add the scope to your expression. Like this:
=(Fields!YourField.Value, "OrganizationId") / (Fields!YourField.Value, "OrganizationId2")

Enable Selection of only two values in SSRS multiple select parameter

I have a SSRS report in which i have a parameter which comes in a dropdown it is a multiselect parameter, now i want that at most user should be able to select only two values from the dropdown.
Although you can't stop the user from selecting more than two values, you can keep the report from being shown if they do. First, I created a red-text textbox at the top of my report that holds an error message. Something like:
You selected more than two values for ReportParameter1, try again...
Then, I set the visibility of this message with an expression (for hidden) set to =(Parameters!ReportParameter1.Count<=2). Now this error will show only when the user has selected more than two parameters.
I then hide the content of my report with a visibility expression of =(Parameters!ReportParameter1.Count>2). Note that you can simply put all your content in a rectangle and then hide the rectangle.
If your user selects more than two parameters, only the red error message is shown. If they select two or less, everything looks normal. I would also write your stored procedure in a way so that if a user selects too many values for the parameter, it won't return any data.
This is not possible. A multi-select parameter is that and just that: a parameter that lets you select multiple values.
If you will always only have two values that need selecting, the easiest way of implementing this would be to have two single value parameters labelled as Value 1 and Value 2 which are then both referenced in your report query.
There are workarounds as suggested by #Kyle Williamson in his answer, but there is no exact answer possible as this facility is not present in SSRS

SSRS Multi Value Parameter. Check whether "Select All" is selected

I have a multi value parameter in my SSRS Report. I want to find out whether (Select All) is checked in that parameter.
In other words, whether all the values in the parameter are checked or only some values are checked.
Is it possible?
I am able to find out number of selected values through Parameters!Parameter.Count. Is there a way to find out total of items in that parameter?
In case anyone is still having issues doing this, I just coded this easy fix.
=IIF(COUNTROWS("dataset").Equals(Parameters!parameter.Count),"it is equal","this is not equal")
For the specific use-case of showing the selected filter on your report in a textbox, here's the expression that will show "All" if "(Select All)" is selected, otherwise it will show all the selected values as a comma-separated list:
=IIF(
Parameters!YourMultivalueParam.Count = countrows("YourDataset"),
"All",
Join(Parameters!YourMultivalueParam.Label,", ")
)
(split onto multiple lines for readability)
countrows reference: https://technet.microsoft.com/en-us/library/dd255215.aspx
Credit to other answers, just want to extend them for this common scenario.
Your approach sounds good: I would make the options for the parameter come from a dataset.
Then you can use =COUNTROWS("DataSetName") to return the total number of options for your parameter and compare this with Parameters!*Parameter*.Count as you suggest.
I also faced this problem and I solved it this way.
I have one multivalued parameter named "Carrier". Then I have added one parameter "CarrierHidden" which is same as "Carrier" only thing is I made its Visibility as Hidden.
="Carrier=" & Switch(Parameters!CarrierHidden.Count = Parameters!Carrier.Count, "All",
Parameters!Carrier.Count > 1 And Parameters!CarrierHidden.Count > Parameters!Carrier.Count, "Multi",
Parameters!Carrier.Count = 1, Parameters!Carrier.Label(0))
The easy way will be to count the number of the selected parameters and compare them to the dataset
=IIF(Parameters!company_number.Count = CountRows("Dataset1"), True, False)
The problem is if you're trying to pull something for another data set then cross referencing the row count in another dataset won't work. You will have to go with what the previous post states. Create an internal parameter of the exact type and assign the default value to the entire dataset. That way you have the max count of the rows since the hidden parameter.count = rowscount. That way you can use it within another dataset also provided that dataset is AFTER the first one is populated.
According to Microsoft's SSRS help search:
=Parameters!<ParameterName>.Count
Returns the integer value 1. For a single-value parameter, the count is always 1.
I verified this does indeed work, check the integer returned for the built-in parameter count field.
Allow multiple values on a parameter selection. Checking the value of the above field will let you know how many values the user actually chose.
In my situation, I allow multiple values on company number. This gives users the ability to choose one company to report on or several at once. Per client request, if they choose more than one, display data horizontally. If only one company is chosen in the parameter list, show the data vertically and hide the other tablix.
So my visibility show or hide expression looks like this in the one tablix:
=IIF(Parameters!company_number.Count > 1, True, False)
and like this in the other:
=IIF(Parameters!company_number.Count = 1,True,False)

SSRS Page break on Tablix with Rownumber ,just one row group and no group expression given by default

I have created a report with one tablix and it has one RowGroup (which automatically came) when I dragged and dropped my report fields. [It doesnot have any group by expression defined]
Now my requirement is to create page breaks based on the row number.
I clicked on the RowGroup properties and give Group on expression
=Floor(RowNumber(Nothing)-1/2000)
And page break "Between each instance of group "
Now page is breaking,but the problem is its breaking for every row in my tablix.
How can I overcome the same and break only at 2000 rows.
This is to avoid Excel export exception on large data.
What am I doing wrong with the tablix/group settings.
I haven't done this before but try adding another group outside you current group with this expression. Then set the page break in it.
Edit: I just re read you question. I think you expression is incorrect. I think it should be:
=Floor((RowNumber(Nothing)-1)/2000)
I couldn't understand how you could set that as the group expression and it would stil group correctly. So you will still need 2 groups:
An outside group with this expression and the pagebreak.
A details group with what you are actual displaying on each row.