SSRS Reports: Drill down with custom columns in each sub-grouping - reporting-services

I want to be able to group information (no problem) but be able to show a completely different set of columns when the grouping icon ('+') is selected. For Instance, lets say the top level report is:
DEPARTMENT | MANAGER | BUDGET # | TOTAL SALES
Expand DEPARTMENT and get
MANAGERS | COST CENTER | NUM EMPLOYEES | Q1 SALES | Q2 SALES | Q3 SALES | Q4 SALES | ANNUAL TARGET
and so forth; there could be one or 2 more drill downs each with different columns. Is this possible? Thanks in advance.

First of all, name the textboxes containing the top level items.
If you right click on the group that you want to be toggled by the top level report item and select 'Group properties', you can select visibility and there is an option for 'Display can be toggled by this report item' If you click the dropdown, you should be able to find the names of the textboxes.
Repeat this for each of the groups, and the textboxes that you want to toggle them. 'When the report is initially run' does exactly what it says on the tin, so set it appropriately.

Related

ssrs group by field name

In SSRS I have a dataset that pulls metrics from TFS work items like this:
ID | Time in Ready | Time in Active | Time in Resolved
-----------------------------------------------------------
1 | 6 | 3 | 2
2 | 2 | 4 | 1
3 | 1 | 7 | 1
I would like to create a bar chart that averages the time in each state like this:
5 | | 4.7 |
4 | 3 | ----- |
3 | ----- | | | | 1.3
2 | | | | | | | _____
1 | | | | | | | | |
-------------------------------------------------------------
| Time in Ready | Time in Active | Time in Resolved
but I cannot figure out what to put in my Category group to get it to group by field names. If I just add the 3 aggregate fields into the Values section, the titles don't show up in the horizontal axis.
Can I produce the expected chart with the given dataset, and how do I setup the chart properties?
If you cannot change the dataset (which is the easiest solution), you could consider using a table and Databars, but it is quite a bit of work.
Drag a table onto your report and attach it to your dataset. For the example above you will need 4 columns. The left most column will be used to hold the axis labels.
Delete the header row in the table.
Create a new Group as a parent of the existing details Row Group. Right mouse click the Details Row Group -> Add Group -> Parent Group. Then in the Tablix Group type "True" into the group by text box. This will group the entire dataset.
Delete the Details Group (right mouse click on the Details Group then Delete Group), choose "Delete Group only" in the option box that opens.
Delete the first column that has True in the first row, this is the group by column and not required. Choose "Delete Column only" in the option box that opens.
If you have not done so at this point add a new column so there are four columns.
Insert a row Outside Group Above (this will be the title). Merge the right three cells. And enter the name of the chart into this box.
Insert a row Inside Group Below (these will be the column labels). Enter the three column labels in the bottom row in the three right most cells.
In the middle row in the first cell enter 0 (this will be the axis), then in the other three cells enter the average calculation for each column. If you want to use data-labels on your bars, I would recommend using a formula like this:
=Format(Avg(Fields!Time_in_Ready.Value),"##.##")
At this point it should look like this:
Then you need to drag and drop a Databar (Column) into the four cells in the middle row. Then right mouse click each one and "Convert to Full Chart". Then delete the chart title, legend and x axis title in each one. It should then look like this:
Then you need to set the axis max and min to the same for each graph. Right mouse click on the axis in each graph and click on Vertical Axis Properties.
In Axis options either set the Maximum to a suitable number or use the following formula to calculate the largest average value, rounded up.
=ROUND(SWITCH(AVG(Fields!Time_in_Ready.Value) > AVG(Fields!Time_in_Active.Value) & AVG(Fields!Time_in_Ready.Value) > AVG(Fields!Time_in_Resolved.Value), AVG(Fields!Time_in_Ready.Value), AVG(Fields!Time_in_Active.Value) > AVG(Fields!Time_in_Resolved.Value), AVG(Fields!Time_in_Active.Value), True,AVG(Fields!Time_in_Resolved.Value))) + 1
You also need to set the Interval in this case I would use 1 but for larger averages you might use 5 or 10. Now run the chart to check the results, it should look like this:
You could add minor gridlines now if you wanted, (by right clicking on each of the axis' and then Show Minor Gridlines) and add Data labels (right click on each bar and Show Data Labels).
Now we need to hide the axis on the three right most cells which hold the bars (right mouse click on the axis then Vertical Axis Properties -> Labels -> Hide Axis Labels).
Then we need to make some changes to the first cell that holds the axis. Right mouse click on the axis then click the Labels tab and click the Hide First and Last Labels (this is needed to make sure the axis' align with the other graphs). Then click the Label Font table and fix the font size at something suitable like 10pt (this is required as we are going to reduce the size of this column and still need the labels big enough).
Now set the width of the first column (axis) to approx 0.8cm and the other columns to around 1.5cm.
The final chart in the Designer should look like this:
The final chart in the Preview should look like this:
You could rotate the category labels by using the WritingMode Property set to Rotate270
The easiest way would be to have your dataset return the data in the following format
Status TimeValue
Ready 6
Ready 2
Ready 1
Active 3
Active 4
Active 7
Resolved 2
Resolved 1
Resolved 1
Then you category would simply be the Status column.

SSRS grouping on multiple tablix

I have main report that has around 10 tablix and one sub report that has 2 charts. I want the each tablix grouped by same column, but every table uses different datasets. By using List control, we can group the tablix and set a page break between each group. For that, list dataset and tablix dataset must use the same dataset name.But I am not sure how to do that for multiple datasets. Could anyone please help me how to group multiple tablix based on same field value.Is it possible using list to do that? TIA
Attached for reference
. Each tablix uses different data sets.but the field names are same.If Service_line column has 10 rows, then I want to display in 10 pages(one page per service line).If I select page break at each tablix, first tablix splits by that field name,after that next tablix starts to split by that field name. I want to show A/R,cash,Adjustments in one page per service_line field and then next page the same tables but different service_line. So I thought Put in List all tables together and grouping at List level will solve the problem.Could you please help me on that? or if you have any other suggestions please let me know. I am not sure how to get this done. Appreciate your help.
If I understood you correctly, what you want to do is modify your data a little and use nested grouping.
Combine your datasets into one dataset using unions and label each row with column 'Category'that has value ('A/R', 'Cash', 'Adjustments')
for example your dataset might look something like this
CATEGORY | SERVICE_LINE | Total | ...
-------------------------------------
A/R | A | 100
A/R | B | 10
A/R | C | 1000
Cash | B | 50
Adjustments | B | 100
Cash | A | 5
Cash | C | 400
Adjustments | C | -100
Adjustments | A | 9999
after that you will create a 1 tablix (forget about the lists). And inside that tablix you will create a row group for Category and merge all columns and set value for the cell as [CATEGORY]. Also for this row group you want to set Page Break options as "Between each instance of a group". After that create a row below that contains all the column labels Service_line, Total, etc.
Now what you have to do is create one more row group as Adjacent Below and use Service_Line as group by attribute.
with some UI tweaking you can get it to look as you want.

Remove Duplicates in SSRS Subreport

I have an SSRS report the links a line item subreport to my main report by an order number. When a customer orders 2 line items, 2 order numbers come in with contact info, etc. In the SSRS report, the order number shows up twice and the multiple line items fall below. What I would like is the 1 order number with the line items following.
As I have it now it looks like:
Order# Contact User
1234 J. Smith JS1
LineItem Qty Order Date
1 3 05/15/2015
2 2 05/15/2015
Order# Contact User
1234 J. Smith JS1
LineItem Qty Order Date
1 3 05/15/2015
2 2 05/15/2015
I tried =Fields!LineItem.Value =PREVIOUS(Fields!LineItem.Value) but because the dup isn't directly previous that didn't work.
But I'd like to have just one single result. Any help would be great.
At the bottom of your design screen should be the Row Groups window. Many times, you will already have a group created. If you right click on it and click the properties it should look something like the image below:
Thanks.

ssrs iif conditional sum based on dense rank

I looked at this thread already but get #Error
SSRS Conditional Summing
Back Story:
I have a ssrs report to qa. Total calls value is going up based on orders value i.e. total calls value repeats if a sales person took 5 orders.
This should not be the case. Example:
left side is wrong right side is correct at employee level in grey.
abc | 500 | order-001
not
abc |500 | order-001
abc |500 | order-002
abc |500 | order-003
So i modified the SP to use Dense rank function.
Now within SSRS
At supervisor level I want to do a sum of total calls
=sum(IIF(Fields!Dense_Rank.Value=1 Or "NULL",Fields!TotalCalls.Value,0))
but this expression is evaluating to #Error at Supervisor level.
Finally, I wish to get a quick fix for this not re-invent the wheel or change the requirements.
Any help would be greatly appreciated.
Assuming Fields!Dense_Rank.Value refers to a column in your dataset called Dense_Rank (naming fields after t-sql functions is not generally advised, as this may lead to confusion), I think what you are trying to achieve is the following:
=sum(
IIF
(
(Fields!Dense_Rank.Value=1 Or Fields!Dense_Rank.Value Is Nothing),
Fields!TotalCalls.Value,
0
)
)

SSRS align columns of chart to table columns

I have a table in my SSRS report showing several values, followed by a column chart in the last row. I require each chart column to be directly under its respective column. Currently, the columns are all stacked next to each other, and I'm unable to position them on the chart manually. Is there a way this can be done?
Example:
A B C
1 3 1
1 1 1
1 2 1
1 2 1
Total 4 8 4
|
| | | --This is how I want it to appear
|
||| --This is how it currently appears
I want to be able to spread out the columns manually so that I can place each column under its respective table column.
I don't know if it's possible to put the bar under the table, but I had a similar problem where I needed to get the bars at the top of my table.
From SSRS 2008R2 in the matrix column group you have the possibility to add a column chart.
You can find the step by step tutorial to this done on the technet site at this link
How to: Display the Same Data on a Matrix and a Chart (Reporting Services)