SSRS Interactive Sorting child group from parent - reporting-services

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.

Related

SSRS - Prevent pagebreak in the middle of a row group

I have an SSRS report that gets exported to PDF and then printed on to paper. The problem I am having is that I am getting page breaks in the middle of a group.
I have MetricGroup - MetricSubGroup and Details. Those are my Row Groups.
I have several different MetricGroups in the report.
I need to make it so that my report will not break in the middle of a MetricGroup.
So right now I get lets say 2 metric groups and half of the 3rd metric group on page 1. Page 2 contains the second half of the 3rd metric group and so on.
I need SSRS to push a metric group to the next page if the metric group does not fit entirely on the current page.
Is this possible to accomplish?
You need to use the KeepTogether option - but bear in mind this is a "best endeavours" process - for instance, you couldn't keep two thousand rows together on one page.
Another approach is to force page breaks and certain parts of the report.
To elaborate a little more on the previous answer, specifying KeepTogether = true for any given tablix member will try to keep all elements of that tablix member together.
So if you specify KeepTogether on your MetricGroup tablix member, SSRS will try to keep all elements of that tablix group together, and when it fails because the report spans multiple pages, it will page break where it likes, resulting in groups breaking up over pages.
If, however, you specify KeepTogether on your MetricSubGroup tablix member, SSRS will try to keep all of the subgroups within a MetricGroup together, which will result in the parent MetricGroup trying not to break on a page if that were possible.
I'm spelling this out explicitly because there's a common degenerate case here - a report without any groupings but with a complex details tablix that generates with multiple rows per data record. Trying to specify KeepTogether on the details tablix will try to keep all of the details together, introducing unexpected page breaks.
In this case you'll need to generate a details group as the immediate parent of the details tablix and group by whatever the report identity is. Then you can specify KeepTogether on the details tablix and it will keep together only the members for one single data record.

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 Report - Subgroup Totals

I have an SSRS report that is currently pulling a single dataset. This dataset contains records of inventory we have. Each record is a separate asset.
I want my report to group by a certain field, and then subgroup by certain criteria that are determined with a couple different fields. Basically there is one parent group, and three adjacent subgroups. My grouping functionality is working correctly, however I am finding it difficult to add totals to each of the adjacent subgroups. When I add a total, it is totaling the specific field within the scope of the entire dataset, instead of limiting the total to just that subgroup.
How can I add totals per field within subgroup?
EDIT: Added sample data and explanation:
You can ignore the function code field, that is what I am using to group on the parent group.
asset number,description,first year,acquisition cost,function code
190,random asset,2008,5000,100
193,random asset45,2008,56000,100
197,random asset26,2014,3000,100
191,random asset27,2014,7000,100
192,random asset36,2013,15000,100
I can't seem to attach screenshots, so here goes..
In the report you can see three subgroups; Assets, AssetAdditions, AssetDeletions. In the tablix, you can see where these groups are positioned. You can also see a row directly beneath the group that is supposed to total the subgroup at the end. However, for some reason the scope is only taking into account the entire dataset. I have tried to modify the expression in the Sum function [Sum(acq_cost), "Assets"], adding in the scope parameter but then it does not allow me to even run the report. It yells at me saying that "Assets" is an invalid scope.
The easiest way I have done this in 2012 VS is to have it return as part of the data set and have it sum up the value.
For instance if you have a quantity for inventory, and you have a subset where you only want the total quantity for that set, you add another column to your dataset called TotalSetQuantity and the subtotal field will have the expression =SUM(Fields!TotalSetQuantity.Value) rather than =SUM(Fields!Quantity.Value).
You can try iif statements within your report like =sum(iif(Fields!ColA.Value=1,Fields!Quantity.Value,0) but I had some troubles getting that to work.
Hope that helps, I ran into this issue this past week and the first option worked like a charm for me.

Grouping in SSRS 2008 R2 - grouping and organizing fields

I am writing a report in which there are groups in 3 columns, and a subtotal figured at the end of each group. When I create the grouping, a column is created out to the left of the report. I am normally in the habit of renaming the grouping column to the field that is being grouped and deleting the column in the report. However, the client wants the field inside the report and not on the outside (in other words he wants the columns to be specifically where he requested them. Is there a way to accomplish this?
Here is a representative example of what I am trying to achieve.
BusinessSegment Entity CostCenter ShipDate InvoiceNumber CompanyCode Estimated Amount
I want to group by CostCenter and CompanyCode, and provide subtotals at the end of each group for Estimated Amount.
You can't group inline except with an aggregate (min, max, sum, count) etc. Otherwise you are going to get the first result something is grouped on and have inaccuracies.
Can you just collapse the values of the grouping instead?
In SSRS generally with reports you have a 'details' grouping whether it is a matrix or a table report. You mentioned 'columns' so it sounds like you have header's of A, B, and C and they want to see a totals. You can generally add a grouping but then have it collapse or expand on demand. That way you present an end user with the data but they have the option of expanding it to see more if they want.
Since you did not specify if you have a matrix I will assume you have one. When you have multiple categories you can hit the grouping of a row or column and if you are having a matrix it is probably using a [SUM(field)]. The grouping of columns are showing all of them, however you can specify they are collapsed or expanded at runtime. Right Click the grouing and you get 'Group Properties'. Select the 'Visibility' pane on the left. Choose 'Hide' radio button and the default for your report will 'collapse' the values to be an aggregate instead of the expanded details of each column. If you want an option to have the user expand or collapse select the checkbox 'Display can be toggled by this report item:'. Choose a textbox or other object outside the collected scope and a user can be presented with the option to collapse or expand on default.

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.