ssrs - grouping rows one per page - reporting-services

I have data that looks like this
Now in SSRS I am trying to create a report GROUPED ON Invoice ID. Basically here is the end result I would like
If someone can give me step by step instructions on how to do this in SSRS, It would be appreciated. Thanks

Start by writing an efficient stored procedure and return the data.
Add a matrix with a detail row in the bottom row/column groups panes.
The row group created in step 2 should have the group Field Set to Fields!InvoiceID.Value
Order the group by Fields!InvoiceID.Value
Add a header/subtotal before or a footer/subtotal after the group based on InvoiceID.
Make another group to store detail data of the invoiceID in the footer of the report.
This should work.

Related

SSRS: How to expend report details horizontally and vertically simultaneously to use minimum pages

I am working with AX to create an RDP based SSRS report and I need help with a certain design requirement in SSRS report.
I need to show student data in header detail style but with header group based on Class Id and detail group based on Student Id.
And the SSRS shows detail data in simple tabular style like this..
But I want the detail data to expend horizontally first in four columns and then goes into next row for another four values and so on.. So that report would use minimum pages possible to show all the data.
Below is snapshot of the sample output I want to achieve:
Kindly suggest if there is any solution to obtain this.
Thanks.
You can use a matrix to force grouping by rows of 4 cells that you can put your current table with Student and Marks in.
Your data would need a ROW_NUMBER added to it in order for the data to be sorted into groups of 4. You could just add another column to your data ROW_NUMBER()OVER(ORDER BY STUDENT_ID) AS ROW_NUM.
Add a matrix to the report and remove the row and column headers so there's only 1 cell remaining (I had to remove them and add the Group back in and remove it again) and set it to the same DataSetName as your current table.
Row Grouping:
=INT((Fields!ROW_NUM.Value - 1) / 4)
Column Grouping:
=Fields!ROW_NUM.Value MOD 4
This will sort your data to have groups of 4 with a column grouping of 0 on the first row.
Then size the cell to fit your table with the Student ID and Marks and put your table in the cell.
I'm not aware of a feature in the SSRS report designer that would allow you to do this. However, you could create a table to be used as data source for the report that has the necessary structure. The table would have 4 student id and 4 marks fields. This should allow you to create the desired design.

SSRS - calulcate sum of rows in a separate column

Is it possible using SSRS report (Tablix) to generate a report in the following format. The details need to be maintained while the total amount needs to be displayed in merged cells.
Desired Output
Current Output
To my existing report i added a group under details. What i got was that the row collapsed into a single record as below
Any help is appreciated. Thanks.
You cannot get this in the format you require.
You are grouping by TransactionID then by the separate amounts (I used a rowID for this to get a unique ID to group on), which means that at the point where you want the merged cells you are grouping by a unique transaction amount. You cannot then group back out to TransactionID.
You can swap the fields over - the total before the amount column. This will work, but likely look wrong for your requirements.
Have a read about data regions (https://technet.microsoft.com/en-us/library/ms156394(v=sql.100).aspx) and grouping (https://msdn.microsoft.com/en-us/library/dd255263.aspx) to understand more about the issue.

SSRS 2008 R2 - Repeat textbox/table on all pages

I have a report in SSRS which basically contains a table of dates and blank columns for users to print and then manually write data into.
The report has a #FromDate and a #ToDate parameter as well as a #Location parameter.
The #FromDate and #ToDate parameters are used to populate a table with dates and is grouped per week (Mon to Sun) with a few extra columns that are blank for manually writing data. Above this table there is a textbox containing employee name.
What I am trying to do is to get the employee name to change for every page according to the #Location parameter. So if a location has 10 employees I need 10 pages with the different employees names at the top so 1 page per employee. The main table with the dates should repeat but the data will be exact on each page, basically the only thing that will be changing is the employee name at the top of the report.
Currently I have tried creating a table with just a header and adding the employeename field into the header but it only returns the 1st employee within the dataset and only returns 1 page when there should be 26.
What would be the best way to achieve this? It seems simple enough in theory but can't get it to do what I need.
A rough outline:
Create a subreport that shows your calendar. It will take the two date parameters.
Create a parent report.
The dataset in the parent should return a list of Employees for the selected location.
Create a table for that dataset, and put two detail rows in that table. The first will just have Employee name.
Test at this point and see that you just get a list of employees.
Place your subreport in the second detail row, and set the parameters to be handed through.
Change the properties of the detail group to have a page break between instances.
If you let us know what isn't working for you, we can give more specific advice.

SQL Server Report Builder - Show Count of Sub Groups

I have a SQL Server Reporting Services report that shows customer order data, but it's grouped as follows:
Store
Customer
Customer Order Items
So, each report is a grouping of stores, with a subgroup of customers per store, and then the items per customer. I'm trying to show aggregate sale and other information at each header record of the appropriate group in the report. Most of this is working well, but for each store header record, I want to show a count of the customers. I'm trying to use some variation and\or combination of RowCount, CountDistinct and other aggregate functions, but to no avail.
Can anyone help me determine how I essentially can get a "count" of customer groups to show at the Store level header? TIA!
CountDistinct on Customer should work fine - no need to specify scope if it's in the Store group header row.
I put a simple test together.
Data:
Report in designer:
Most important thing to note is the CountDistinct on Customer in the Store header row; this is just the expression used:
=CountDistinct(Fields!customer.Value)
End result, showing correct values:
Please let me know if I'm missing something.
Edit after comment:
Apologies in advance for how long this is getting.
The previous report did have row groups for Store and Customer, but I've modified this to make it more clear, hopefully. Still based on the same DataSet:
You can see there are three row groups, and each row in the report is actually a group header row belonging to one of those groups.
In the Store group header row I've kept that same CountDistinct expression. I've also added a CountRows() expression to show how many actual rows are available in each of the different groups.
Here you can see for Store1, CountRows is returning 4, i.e. there are four rows that we are aggregating in this scope, which is what we expect looking at the DataSet.
Similarly, when we apply =CountDistinct(Fields!customer.Value) in the Store scope we are considering these same 4 rows, and we see two distinct customers for Store1, which seems correct to me.
For Store2 we are considering 6 rows in total, which have three distinct customers. Again, just by applying =CountDistinct(Fields!customer.Value) we get correct value.
Hopefully this rejigged report helps clear things up. If I'm still not getting your requirements, can you please explain what numbers are wrong in my sample report based on my sample DataSet? That way I can adjust things easily on my side.

SSRS Subreport or other solution

I am working on a report that will show scheduling data. This report will need to show data for any job that has a promised date between a specified date range.
The issue I am running into is how to best display this data, I have a dataset built that has header info (Job #, Description, Due Date etc.) which returns a single line row for each job.
There are then several detail records for each job (Line item descriptions / details, Work center descriptions and details). Each of these could return several rows.
My question is how to group this detail data with each header record. Hoping to have something like this with one record block per job:
-- Header Dataset Job Number , Job Desc, Date Ship By ... etc.
--Line item description dataset
--Work Center dataset
Next record.....
Thanks in advance for any help.
Brian
If each of the records in your dataset have a field that they can be grouped by then this is actually pretty easy. You need to use the grouping feature of the table in SSRS. It's easiest to create a view that contains all the rows (both headers and details) logically and pass it to SSRS as one dataset.
Here is a recent walkthrough from Microsoft. You can change the version number to match your specific version since you didn't specify in the question. Group header fields can be formatted distintly to make them standout etc.
http://technet.microsoft.com/en-us/library/dd255263.aspx
If a field that you can group by isn't contained in the dataset in the report, i.e. it's a foreign relationship or something and you can't put them into a single view then you'll need to look into sub-reports. Based on the information provided however a simple row or column group should work just fine.