SSRS 2008 Interactive Sorting in Sub-Report not working as expected - sorting

I have a (parent) report that has a list. The details group of this list contains one sub-report. So basically if the list has 10 records (rows) the sub-report is executed 10 times.
The problem seems to be with interactive sorting in the Sub-Report. It has 4 columns with interactive sorting enabled. When I run the parent report and try to sort columns SSRS "remembers" the previous sort column and sorts by multiple columns at the same time. For example if I sort by Col A then click to sort by Col B, SSRS will preserve the sorting of Col A (and the direction) and then apply the sorting to Col B. However I simply want to sort by Col B and do not want to Col A to be part of the sort.
When I try this directly with the sub-report everything works as expected.
Any ideas why this is happening?

This is a potential bug in SSRS 2008. I used a table instead of a list in the parent report and everything is now working correctly. Go figure!

Related

BIRT suppress multiple duplicate columns

I am working on a BIRT report. Its records are grouped on the basis of the status column. I was looking for an option in the Eclipse BIRT tool by which I can hide combinations of multiple columns in a row which are repeating. I have attached screenshots for both the current report and the expected report structure.
I tried the "suppress duplicate" option but that is limited to a single column. I am not able to apply this on multiple columns together. I couldn't figure out any other option. Please suggest any solution in the tool or do I need to change my query to return the result in the expected format?
Actual Result:
Expected Result:
There are three obvious ways to hide duplicate values.
All of these require you to configure this per column (BTW I don't understand why you consider this to be a problem).
As you already did: Use "suppress duplicates" at the column level.
Add more groups to your table after the existing group.
E.g. one group for the first column (whatever that is).
Then you can choose "Drop" "detail" in the properties of the corresponding group header cell. It's a bit difficult to get the layout right this way.
In your data set, if it's SQL, you can use a little construnct with CASE and the LAG analytic function to compare the column value to that of the previous row, and if they are equal, return NULL instead (pure SQL solution).

How To Sort Specific Column Data in SSRS Tablix

I am using Visual Studio 2012 for SSRS and my queries come from using Microsoft SQL Server 2012.
My question below pertains to SSRS and sorting.
In my Tablix, I currently have the Row Groups set up as Group -> Manager -> Owner -> Status Description and when it pulls the data from the data from the dataset, it pulls in fine. In the tablix, basically everything is a drilldown and each of the Row Groups (except Group) is hidden initially and can be displayed/toggled by the report item ahead of it. In the Status Description part, when it pulls in the records, it pulls them in as Active, Completed, In Process...which is fine because they are pulling in ABC Order.
But I want to show that specific column when it pulls in as Active, In Process, Completed...in the way that a specific file would go through the process. These are only 3 specific ways the data could pull it as, there are more, but these are the most common seen. How do I sort that individual column to get it in the way I mentioned above or a way that I can customize the sorting based on how I want it to be seen?
You can use expressions in the sort order to get the sorting exactly as you'd like.
What you can do is use the SWITCH statement to number your output in the order you want. For example I have 3 statuses: "Complete", "On Hold" and "Word at Risk". Normally they would either sort as Ascending or Descending... but if I enter this in the Sort Order Formula I can change that:
=SWITCH(
Fields!PRS_STATUS.Value = "Complete", 1,
Fields!PRS_STATUS.Value = "Word at Risk", 2 ,
Fields!PRS_STATUS.Value = "On Hold", 3)
And now it orders 1,2,3 aka Complete, Work at Risk, On Hold.
You can put this switch in a larger switch statement to have multiple sort orders depending on a criteria or parameter.

Sorting a CrossTab Report Crystal Reports

Recently I had a problem with sorting a crosstab. I finally found a way to display the results as expected so I thought my solution may eventually help somebody else.
The "original order" doesn't work within Crystal Reports crosstabs unfortunately. The original "order by" section of my sql query contained two column: first a nvarchar column then a int column. In my results I only needed to display a concatenation of those two columns so the results normally looked like this with sql : A1, A2, A3, A10, A11.
But when it came to display the results in a Crystal Report crosstab, the sorting was different because crosstab's sorting is based on the columns/rows displayed only, not the "original order by" from the query results, so the results showed with the crosstab was instead: A1, A10, A11, A2, A3.
My way to solve this issue was to add those 2 fields within the rows section before my "concat field" because they were required for the sorting and to display only my "concat field". To hide fields within a crosstab, just go to this tab: "Customize Style Tab" (from the Cross-Tab Expert). Then select the field to hide within the Rows section and click "Suppress Subtotal" and then "Suppress Label". And it worked like a charm. Hopefully it will helps you guys saving time.
But This solution have some limitations like
if you want to export the report in Excel then it will add extra cells in grand total.
otherwise it is a good to go.
Example:
If you have 3 rows(A,B,C) to display and you added one row and you suppress it to solve your sorting issue then in Excel its grand total looks like
A B C
a 1 3
b 2 2
---------------------------
Total: 3 5

Trying to SORT table on Expression

I have two tables in my report. Grouped on fields DatePaidFinancialYear and then SupplierName.
I have removed both sorts on the groups themselves. There is also no sort on the tablix.
I then have a COUNT IF in one table that does the following -
=Count(IIF(Fields!DaysLateCategory.Value = "Over10Days" , 1, Nothing))
and the below in the other
=Count(IIF(Fields!DaysLateCategory.Value = "Over30Days" , 1, Nothing))
This gives me below -
I want to sort so that the highest number is at the top. I can't work out how to do it.
When I try and sort by my counts via the Tablix - I get the following error -
A sort expression for the tablix 'Tablix5' includes an aggregate function. Aggregate functions cannot be used in data row sort expressions.
Please advise
IRC - you should remove the table sort and sort using the same expression on the Group properties
Excellent. I could have sworn I tried this but obviously not. All working now.
Thanks

SSRS How to order tablices in a List Control?

I am developing an RDL in SSRS 2008. I took 3 subreports and converted them into one report. So now I have one RDL file with 3 tablices. But one dataset since I merged all 3 subreport datasets into one now. (So I just joined each of these 3 tables into one).
But now I want to sort all 3 of these tablices by date field common to all. I know I have selected a date field that all 3 tablices join on. Then I wrapped all 3 tablices in a List Control and set this List Control to Sort by this date field: "actual_date".
But now when I view report output, it instead sorts all of Tablix A by actual_date, followed by all of Tablix B by actual_date, then followed by Tablix C by actual_date.
Instead, if a record in B occurs prior to a record in A, then I want that one B record to be listed before this one A record. How can I achieve this?
You need to combine the tablixes into one. SSRS won't split up a tablix and interleave it with another one.
So make a tablix that can contain all three types of data. You can use expressions in the cells to change what field the cell displays. Then set the sorting at the appropriate level (details group or a parent group.)

Resources