Interactive sort over multiple groups in ssrs - reporting-services

I have a report that is grouped by Region and then Office location. The users would like the ability to sort on a date value. I can get it to work for the innermost group (Office location). However they want it to sort the whole table. Any ideas?

Add sorting to the table column.
Right click on the table column ->
Properties
Click on Interactive Sort
Click "Add interactive sort"
For the Sort Expression, put "=Fields!COLUMN_NAME.Value"

I solved this by using a hidden Chart placed outside the Groups.
Set as the following, for the column header that holds the interactive sort:
And for the chart:
At the Category Group, go to Properties, and remove any Sorting from there.

Another simple way to solve this is to add two tablixs. One with the grouping, the other without.
Then you can add a "Group on X" boolean param and show and hide each tablix dependent on the users selection.
The best of both worlds and no need for two separate reports. The user can easily sort and export the entire dataset if required.

Related

Change sorting order arrow in SSRS from ascending to descending

I have Interactive sorting on each column in my report, but when i want to sort (first click on the sort arrow) i get by default ascending sorting. How can i change this so when i click interactive sorting to get by default descending order on all my columns.
For now i have just added interactive sorting on each column but by default sorting is ascending.
Somehow i think this can be changed in rs config , but i don't know how.
I've actually found multiple solutions that could be helpful, so I'll go ahead and submit as an answer and hopefully one of my suggestions will solve your issue.
As I mentioned in the comments, it is possible to sort the data on report generation if that is a suitable option for your report. To do this, select the column that you wish to sort in descending order, right click to open the "Tablix Properties", switch to the "Sorting" tab, add the field that you want sorted, and switch the sort order to "Z-A". This will sort the report initially in descending order.
If you prefer to leave the report sorted until a click on the interactive sorting, the simple solution to this is to change the expression for the interactive sort to =Fields!Month.Value * -1. This will simply reverse the order that it sorts by, though the arrows do not change. Additionally, I should note -- this only works on numeric fields. You'll receive an error if attempting this with any text fields.
I found a segment of a book on advanced SSRS techniques that may be useful... or may not. It looks like the SSRS report renders as HTML and generates an onclick event. The default image that is rendered is called unsorted.gif and changes to sortAsc.gif or sortDesc.gif. It may be possible to insert some custom HTML that would sort correctly? I'm not sure if the tags included are supported within SSRS, but it's potentially useful for your purposes.
Right click the row group month, select group properties, select sorting, click on order and select Z to A.
When report is first run it will be in descending order with available interactive sorting.

SSRS Interactive Sorting child group from parent

Here's the issue.
I have the following report, which consists of a table (not matrix) that has 3 different levels of grouping
Report Design
I'm quite familiar with a basic function of interactive sorting, but what i need to do here is as follows:
Having in mind the pic previously shown, I need to add a Interactive sorting to the column "Porcentaje %" (percentage) in each one of the repetitions of LV1 entries, the issue is that I need that the sorting works on the LV3 group WITHOU affecting the sorting of LV2 group.
I have made the basic configurations on the Textbox Properties dialog, in the Interactive Sorting section, and the report do not crash, but also doesnt sort the information.
any ideas on how to do this?
Also, the headers are part of a ColumnGroup that repeats on each month i'm filtering on the report. Said group has the property Hidden set as true, and is toggled by a "Totals" columns outside the group.

Create an expression based off grouped rows ssrs

I want to create a single rectangle on a report that displays red if there are more then 2 distinct projects being worked on within that week (see image below):
http://imgur.com/dPHW1TT
I'd need to write some kind of expression like IIF(CountDistinct(Fields!Project_Name.Value)> 1, "Red","White") but the issue is that I need the projects to be aggregated per user.
As you can see in the above report I have it grouped on User >> Project, and thats what I'd need to captcher in this single expression.
Is there any way to specify a group in an expression?
I've actually managed to do what I wanted via filtering on the tables group, and then hiding all the cells bar one in the table.
http://imgur.com/G8IKMbS
Although if anyone knows a way to group within an expression I would still be interested in knowing.
Thanks

How can I add an interactive sorting on expression column in Sql Server Reporting Services Report

Hi I am new to SSRS and I created a form. I also added a couple of column based on expressions. I was trying to sort the table on the basis of an expression column but the option is not available in cell properties - interactive sorting. Can anyone please guide me on how to achieve it. Thanks.
You have two ways of solving this that I can think of. You can either:
Move your calculated columns to your Dataset
When you add a dataset to a report, on the Fields tab you have the option to add Calculated Fields. If you add your expression column here, you will be able to use it in the Sort tab of your Tablix just as you would a normal column.
OR
Repeat the expression in the Sort property.
If you are not able to create your calculated field on your dataset (perhaps if you reference other datasets or do something out of scope), then you will need to duplicate your expression in the Sort tab of your Tablix. (To access this, click anywhere on your table and then right-click on the small grey square in the top left-hand corner of your table).
If you click Add for a new Sort condition and hit the fx button, you can paste the same expression you used for your column into here and use it to sort your dataset.
The downside of this is that you're replicating your logic and potentially duplicating work.
To enable the interactive shorting in a table you need to have a row group. So by this you can sort the whole table or only a portion of the table.
Say in your case you need to sort the table basis of some expression. For an example you need have an interactive sort based on the values. In the below screenshot I have 2 groups i.e. Customer and Project and I want to have an interactive sort based on the revenue.
Now right click on the Revenue and go to the 'Textbox' properties and select the group and sort by. Here in the screenshot I will sorting based on the total revenue for different Customers.
Now after running the report if you click on the Revenue column it will sort accordingly.
Let me know if this is what you are looking for.

SSRS 2008 Sorting Not working

I can't figure out why sorting is not working in my SSRS Report. I have a Tablix on the report that groups by column A.
When I preview the report, Columns B - N have sort handles at the top (little black triangles, one pointing up, one pointing down)
When I click one of these SSRS pretends to sort the data, but when it finishes, the data is still in the original unsorted order. Why?
Edit - These columns are within a grouping. When I take the grouping out, they will sort as they should.
When I try checking "Apply this sorting to all groups and data regions" and setting it to the name of the grouping I get the following error"
The tablix ‘tablename’ has an invalid SortTarget “group_name”. The scope must be the current scope, a peer scope, which is a data region, or an ancestor scope. If the current scope and target scope are groupings, then both scopes must be along the same axis.
What does this mean? I have tried every option in the dropdown and it either results in the error message or the same non-functioning sort I was originally dealing with.
For the column headers that have the sort triangles, check the Text Box Properties. Under Interactive Sorting, check to see that the Sort by: expression is set as expected. You probably want to be sorting the Detail Rows for "Choose what to sort:"
For sorts groups, click on "Rows Groups" and select row what you want sort and click on "Group Properties" and go to "Sorting" and then select your column.