SSRS: repeat tablix left-most row group value on each row - sql-server

I have a tablix in an SSRS 2008 report. It has two-level row groupings, and I'd like the value for the left-most grouping to continue to be displayed on each row. Eg, I get this:
group1 subgroup1 500.00
subgroup2 250.00
... but I'd prefer...
group1 subgroup1 500.00
group1 subgroup2 500.00
I can't seem to find the option for this. Is it a strange thing to want?
Thank you,
Bill

You can simply edit the upper reporting level, to be grouping on both groups at the same time, this will cause your desired behaviour.
I had to resort to this solution once, where "hide duplicates" didn't seem to achieve the desired result.

It's so simple...you have to right click on the cell in the DATA area (ex. where is displayed the value 500) and to click add COLUMN on the left. After this change the value in the new cell with the label field (subgorup1), also do this for the others columns that you want to add, but remember to do it from the DATA area. when you finish, delete the columns out of the data area, but keep the row groups. nice try!

Currently, what I've found to be a good way of determining whether or not the repeated values of a group would show up in a SSRS report, is to create the Groups and build your report based on the groupings. Secondly, take the groups fields and duplicate the column to the right hand side of the report. Making sure that you've included all the columns needed and totals are correct; delete the grouped columns. When you do this, you will get a popup asking if you want to delete the group or just the columns, chose columns - this will keep the format of the initial report and keep all of the total line as well.

If you select the row in question, there is a field called Hide Duplicates. Set this to nothing (null, space, etc) That should return the values you want.

I had this same issue and I solved it really easily.
It seems you have two row groups, by group and by subgroup.
What you have to do is to select the first column and group by group and by subgroup and remove the grouping by subgroup.
That should do the trick.

Put ROW_NUMBER() OVER (ORDER BY name ASC) AS Row# in each query as a serial number and hide the row in the SSRS Report.
See: https://learn.microsoft.com/en-us/sql/t-sql/functions/row-number-transact-sql?view=sql-server-ver15

Related

How to create a pivot table/chart for quarter data?

I am trying to create a pivot table that I can get the top 10 categories by quarter using the table below based on the numbers. In conjunction, I want to make a pivot chart that will allow me to select what quarter I want to show as well. Is this even possible? Thank you in advance.
I'm going to take a guess that you don't have an answer yet because this is poorly tagged?
Anyway, here's a quick stab, seeing as nobody else has stepped up to the plate yet.
If your data was in an Excel worksheet then you could easily make this into a Pivot Table, simply highlight all the data and Insert - Pivot Table. You would wants your rows to be "Category Association", and then you could add "QTR1" to "QTR4" as "Sum of" items to the "Values" part of the Pivot Table.
To get the top 10 per quarter you would need to click the arrow in the "Row Labels" cell and pick "More Sort Options". Then "Descending (Z to A) by:" pick "Sum of QTR1", then "Sum of QTR2", etc. If you want all four at the same time then make four pivot tables. To get the top ten you would either count the rows manually, or use formulae to present this on another worksheet.
You can make a pivot chart by simply clicking the pivot chart button when you have a pivot table selected. You can then select which quarters to include by ticking/ unticking them in the "Pivot Table Fields" section, but note that this will also affect the pivot table you picked to make into a pivot chart. Again, you might need to make a new pivot table to be used for this purpose?
So everything on your list is possible, it's just a case of trying it I guess?

Summing the Non-Null results in a matrix

I have a report that looks like the picture below. It is a matrix with person name on the rows and weeknum on the columns. What I need to calculate is the number of weeks that have data in the calls taken column. In the picture below it is the consistency column with the red numbers. I can't seem to get those red numbers to appear. Is there an expression that can count the number of columns that aren't null in a particular matrix. This report will be dynamically generated and the number of weeks will be totally different each time.
I would rather solve this in SSRS because I don't want to mess with my SQL too much but if no SSRS solution is possible I can post my SQL and perhaps solve it that way.
You need to create a column group outside of the last group. So in your example, Right click on the column tab above your efficiency column in the 23rd week. After you create this column, you can use a simple Count(Fields!CallsTaken.Value) in an expression to count the times there are values listed.
Reference SO question on Horizontal Totals.

SSRS. How to create new Row Group in right side of the table1_Details_Group?

I'm creating Report with Microsoft Visual Studio 2013.
PROBLEM:
If I'm adding new Row Group It automatically adding before table1_Details_Group
QUESTION: How to change order of the groups or add new group in right side of the table1_Details_Group?
EXPLAINATION:
For now, after adding row group It looks like:
Picture 1
As you see in picture 1 group is created in left side of table1_Details_Group
It should be like that:
Picture 2
As you see in Picture 2 is shown how I want to move Column3 with grouped rows.
If impossible to make that is shown in Picture 2, have you ideas how to add all group with parent and all childs to right side of table1_Details_Group as shown in Picture 3 below?
Picture 3
For anyone else coming here, you can insert a second detailed table inside a cell of the main table that has the detailed breakdown. This detailed table can be in any column without affecting the way rows are broken down in columns to the right or left.
So to solve the original question, first create Columns 1-3 in picture 1, and only include the data groupings required by those columns (ie. don't create the detailed row groupings for columns 4-5). Then insert the column where you want to show the detailed rows (ie between columns 2 and 3), and insert a new table inside that cell. This inner table will already be locked to share the same dataset as the main table. Then you can set the grouping of the inner rows and add whatever cells, rows or columns you need to the inner table. The columns to the right in the main table will still show the total, as in Picture 2.
I found solution, I don't know If It's good practice, but It worked for me.
I've created second table in right side, added similar group as in table1, and from new created table2 deleted all grouped columns, left only column which I needed, in this example Column3. So for now It looks like 1 table. Column1 and Column2 from Table1 are associated with Column3 from Table2.
You can change layoutdirection of table from LTR to RTL.
go to tablix properties and collapse localization and then change layoutdirection
I have had this same issue. The use of a second table was not perfect for me because when the report is viewed in HTML there is a space between the two tables, which looks weird (it worked fine in PDF view).
To resolve the issue, I created the table in picture 1 then removed all non-grouped columns (the table requires one visible column, so I had to keep a dummy column set to hidden).
Then I added new columns inside the grouping. In the cells for these columns I inserted another table. This inner table only has one cell with the value that I needed to display. The inner table then gets a filter so that it only displays values related to the current row of the parent table.

Creating a Batch Report

I am trying to create a batch report of multiple invoices using SSRS 2008 R2.
I have created the initial invoice report and have it set up with a parameter; the parameter uses an InvoiceID to populate the data within the invoice report.
I have created another report using lists, inside the list contains the information that was in my original invoice report but using a different parameter (BatchID). The problem I am running into with this is that instead of creating a single invoice for each invoiceID it is creating an invoice for each line item within each invoice. i.e.~ Instead of incorporating multiple items based on the InvoiceID (as the original report did) it is creating a report for each of the items.
What would be the best way of running a batch of these invoices? Am I going about this the wrong way or am I on the right track but missing something?
Thanks in advance!
SELECT i.InvoiceId, i.InvoiceNumber, i.BillTo_Line1, i.BillTo_Line2, i.BillTo_City, i.BillTo_StateOrProvince, i.BillTo_PostalCode, i.CustomerIdName,
i.ce_OutstandingBalance, i.ce_BillToDate, i.ce_BillFromDate, i.TotalAmount, id.ProductIdName, id.ce_customeridName, id.ce_CustomerProductName,
id.InvoiceDetailId, id.BaseAmount, id.PricePerUnit, id.ce_rate
FROM
Invoice AS i RIGHT OUTER JOIN
InvoiceDetail AS id ON i.InvoiceId = id.InvoiceId
Once I enter the invoiceID I get my report
My intent is to be able to run the report against multiple invoicesid numbers without having to select the invoice number itself. I have another table that collects the invoiceid's based on a batchid that they are run in.
So far I have attempted to create a subreport with the original report and Create a separate report that uses a list and attempt to group by InvoiceID for each batchid. Though with each of these I have so far been unsuccessful.
I am new to SSRS and have been pouring over documentation from MSDN about SSRS and the different abilities.
For this sort of repeating list, it's a matter of understanding how a list/grouping works.
Lists, Tables and Matrixes are all the same underlying object - the Tablix.
A List is a Tablix with one detail row (i.e. one Tablix row for each row in the Dataset), one textbox in that row, and a Rectangle in that textbox. The Rectangle can have various embedded elements like more textboxes and as such provides a repeating free-form item for each row in the Dataset.
You can see this when you create a List in the designer:
I assume your report query takes a BatchID and returns a number of invoices and their invoice details. I've taken some liberties with your data and created a simplified sample Dataset:
You want the Rectangle to repeat for every InvoiceNo. Currently the Row Group has no grouping item - change this to InvoiceNo under the Group properties and expand the Rectangle as required.
You can start adding in elements such as textboxes for the Invoice level items, something like:
Note that the left side of the Tablix has changed from lines to a bracket - this is because a grouping item was added to the Row Group.
This will repeat once for each InvoiceNo. Now we want to add the line items - you can do this by dragging a new Table into the Rectangle. Since we have a Row Group in place this table will only display items in that group:
When run for the sample data, this gives an ugly but functional repeating invoice report:
This could be tidied up as required, and page groups inserted between Group items in the Group properties as required.
Hopefully this at least gives you a rough idea of how you might go about your task.

tablix returns only 1 record for dataset

I have a tablix on an SSRS report:
When I run the report it only returns 1 record!
I did a sql server trace, and the query that is being executed is returning 14 rows.
On the same report, I dropped another table, and put just one field on it, and it returns 14 as expected. I noticed that the difference between the one that works and that one that doesnt is:
How can I get those 3 horizontal lines on the one that doesn't work?
What could be my issue? What did I do wrong?
The screen shot shows you don't have any groups. You deleted the details group from the Tablix. You can add it back in by inserting a new group or building a new tablix object from scratch.
To add a group, click on a cell in the row that should have a group, in this case the [ReferredBy] cell. Select Add Group -> Row Group -> Adjacent Above. If your data is already grouped at the correct level of granularity, then select Show detail data in the Tablix Group screen. This will add the details triple bar in a row above your current row. If you need to group on something, then pick the field to group on. This will add a ) in a row above your current row. Copy and paste the contents of the cells in your existing row into the new row and delete your original row.
One row when you expect multiple sounds like a grouping issue. Debugging something like this I would create a new table element below the current one and drag and drop a single column from the dataset. If it returns 14 you know it is not the dataset being evaluated as a problem but the table's expression. If it is also only returning one you probably have a predicate, filter expression, or parameter setting limiting the scope down as well.
Probably, you set the expression for Textbox and not for the RowGroup.
Just find the Group Properties then put the same expression in Group On.

Resources