SSRS report. I need to total non aggregate data - sql

I'm quite new to ssrs, so please bear with me.
To simplify - I have a sql server table with 3 columns -
ProductGroup, ProductName, ProductWeight.
My query simply selects everything, ordering by productGroup.
In my ssrs report, I need all individual rows displayed. Straightforward enough.
However, I need to insert a total ProductWeight for each ProductGroup. i.e. I need a rows with these totals between each changing of the groduct groups.
I can't simply aggregate the ProductGroups as I need all the individual records displayed.
I hope I'm making sense.
Many thanks.

This is actually very easy to do, but not obvious if you are new to SSRS.
When you are is design mode in the report development tool (assuming you are using Visual Studio (or BIDS)), look for the Row Groups section down at the bottom of the window. You should see a row in that list that has the text (Details) in it. Right click on that row, hover you mouse pointer over Add Group, and then choose Parent Group… from the context menu. Choose the column to group by; ProductGroup in this case. Click OK.
You will see a new column at the front of the tablix for the ProductGroup. Right click on the detail row under the new column, go to Add Total, and then choose After. This will create a new row below the detail row where you can add aggregates for columns where is makes sense. When you hover over this row for the ProductWeight column, you will see a little field chooser button, click that and choose ProductWeight from the dropdown. By default, that adds a Sum aggregate into the new row for that column. You can change the aggregate (to an average, perhaps) by right clicking on the cell, and choosing Expression from the context menu. Preview the report to see if that is what you need.
At this point, you can remove the original Product Group column since it is no longer needed.

Related

VB.Net & RDLC reports: Display dataset records as fixed fields

I'm developing a rdlc report, that uses the data from a dataset, programmatically filled (from VB.Net). I need to display the data of the dataset as in the linked photo, so not in a classic "table" way, but each page of the report will concerne only one record of the dataset. Any cells of first page will be filled with the data of the first row of the dataset, the second with the second and so on.
Is it possible to display the report in this way with rdlc?
Further to my comment, I believe it's possible to do what you want using the table, with a bit of work on the layout.
Start by adding a table in the normal way, and get that basically working ie so that it shows all the data across one row. Then work on re-arranging the cells so that they are in vertical columns. Do this by right-clicking in the shaded area to the left of the rows, and select 'Insert Row'
Finally create a group around the whole thing, and group by Item Number or w/e is appropriate for your data. Then in the 'Row Groups' window at the bottom of the designer, right click your new group and select 'Group Properties > Page Breaks > Between each instance of a Group.
This should get you pretty close to your required layout.

SSRS Row Gropings Inverted (Export to Excel)

When i run my report my report in SSRS all groupings work correctly however when i export this report to excel the proper rows are grouped but the grouping is inverted (i.e. the last item in the grouping has the '+' sign instead of the parent, top row)
thanks for any help in this matter!
In SSRS, when exporting to Excel, if the report item that controls whether another item is toggled is not in the previous or next row or column of the item being toggled, the outline is disabled also. See:
https://msdn.microsoft.com/en-us/dd255234.aspx
This can happen if you have your total added after the group rather than before.
(right click on the group and click add total before)
However, we really need more details/screenshots to see what the cause might be.
The drilldown in SSRS has more features than the grouping in Excel can handle so sometimes it is not possible to get in excel what you have in your report..

Mismatch between row sum and column sum when hide any value from row or column in PRD cross tab report

I have to hide some member either from row or column (like [Markets].[APAC]). When I hide this member then in "Grand Total" still showing the count of hidden column.
Here is sample query ... similar to my requirement....
select NON EMPTY Except({Hierarchize(Union({[Markets].[All Markets]}, [Markets].[All Markets].Children))}, {[Markets].[APAC]}) ON COLUMNS,
NON EMPTY Hierarchize(Union({[Product].[All Products]}, [Product].[All Products].Children)) ON ROWS
from [SteelWheelsSales]
where {[Measures].[Sales]}
Please provide solution on this ..
Thanks in advance.
Sagar
Not a lot of context here, but assuming you are an EE customer doing this in Analyzer, there are a couple of relevant options:
Under "Report Options", or by right-clicking on the Grand Total label, there is a check box to toggle display of totals that include filtered out values. Depending on your version, which you did not specify, this may be defaulted to include the filtered out values. Unchecking it would correct your problem.
Also check out the "Subtotals" option in your measure's right-click menu to ensure your aggregation type is correct for your purpose.

SSRS Export to Excel does not do expand/collapse of groupings correctly

My report works and looks perfectly in the web viewer and looks great in PDF export as well. But when I export to Excel the exported file does not do the groupings correctly. The intent is to have a list of all employees and have their list of accounts underneath that is collapsible. However in Excel the entire report is grouped under one header and it collapses the entire report instead of allowing each header to collapse.
This is the proper way / web viewer:
But excel is collapsing the entire report not just each header:
I found the answer in this comment left here where the author mentions the way to do groupings.
http://connect.microsoft.com/SQLServer/feedback/details/508823/reporting-services-2008-group-by-export-to-excel-duplicate-rows-csv-ok-pdf-ok
The easiest way I've found to "fix" this is to re-create your hierarchical groupings (and the rows contained). Starting from the detail row (assuming you still have one) select the row header, right click for the menu, add new parent group using the next hierarchical level up. This creates a fun column that is to the left of your previous content separated by the dashed line. Select the column, right click for menu and choose delete. In the following dialog just remove the row, not the group you just made. This leaves the grouping containing only the details row/group. Select the existing details row header again, right click again, and choose to insert row > Outside Above (or below as your need might be). This adds the row to the next outer grouping from the selected detail row, similar as how 2005 allowed us groupings.
If I remember correctly SSRS 2008 can't deal with 2 level of grouping on the excel export (that was a confirmed bug), but i thought that was fixed either with SSRS 2008 R2 or a CU later on. Are you on the latest available version of SSRS ?

Group and subtotal columns in Reporting Services 2005

I have a report (RS2005, against a MSSS2005 instance) which I have inherited. It shows a basic table of data: a handful of key fields which are used to group rows together, a few basic numeric fields, then a number of dated ('bucketed') fields (e.g. 1 month away, 2 months, 6 months, a year, 2 years, etc.)
The user would like to group together these dated fields in aggregated groups and be able to collapse or expand the columns as you can the rows. So we'd be able to show the next year's values' subtotal or expand it to break it out by month. Hiding the invidual months if the subtotal is shown.
This is basic pivot table behaviour (and can be done with the Group/Subtotal feature on Excel - that's the closest analogous behaviour I could use to describe the requirements).
While grouping by rows seems trivial in RptgSvcs, grouping columns and collapsing a group into a single subtotal and blowing it out again, seems hard to impossible.
Unless someone knows better?
You should be able to do this by selecting the columns that you would like to hide and set their visibliity to be hidden.
Then set the toggle item on the hidden columns to be the textbox that shows the subtotal.
This textbox will then have the [+] symbol on it, and clicking will show/hide the your month-by-month breakout(the hidden columns).
On the right hand side of the table control on your report (RDL file), you should see icons representing the detail and grouping information for the table.
Here you can see whether or not a grouping has a header/footer and how it is calculated e.g. =SUM(fields!mySalesValue)
You can also set things like whether it is collapsed and so on