SSRS report show static headers on the left and group by ID - sql-server

I have the following DataSet on a SSRS report:
SELECT
VariationCode.Code
,VariationCoding.Comment
,VariationCoding.SubmissionDate
,VariationCoding.Id
FROM
VariationCode
INNER JOIN VariationCoding
ON VariationCode.Id = VariationCoding.VariationCodeId
WHERE VariationId = #VariationId
I am showing static headers on the left and data on the right which works fine but I'm struggling to group the results by ID and show them as a separate table per grouping.
Grouping the row by parent using VariationCoding.Id shows one table with no grouping at all. I suspect having the headers on the left is the problem since most solutions I've seen have the headers on top.
How can I show static headers on the left and group the results by VariationCoding.Id in such a way that each result will be displayed in a separate table?

group the results by ID and show them as a separate table per grouping.
You may want try Page break option, from Group Properties, screenshot for your reference.

I ended up using a list control to solve the problem as described on Microsoft docs -
https://learn.microsoft.com/en-us/sql/reporting-services/report-design/create-invoices-and-forms-with-lists-report-builder-and-ssrs
A list data region repeats with each group or row in the Reporting
Services paginated report dataset. A list can be used to create
free-form reports or forms, such as invoices, or in conjunction with
other data regions. You can define lists that contain any number of
report items.
By creating a table with static columns on the left and nesting it inside the list control, I was able to bind the table data columns to the list data source and this grouped my custom table per record.

Related

Dynamic Parameter showing too many values

I am currently creating a simple report in Crystal Reports with two tables:
{Table1.group_name_id} --> {Table2.technical_group_id}
Table 1 holds all of the groups; ID's, Names etc
Table 2 holds only the technical groups ID
With these two tables linked it means the only records that will return are those where technical groups are involved, perfect! But now I want to add a dynamic parameter to return the Technical Group Names for the End User to select.
Because {Table2} only holds one field (the ID) which links to {Table1}'s ID, I have to perform the Parameter selection on {Table1}'s name field.
But this is pulling back all of {Table1}'s names and is discounting the Join on {Table2} even with an enforced join present.
Is there a way to force it to only pull back {Table1}'s names as long as it matches the JOIN between {Table1} and {Table2}?
Thanks in advance!
Edit (additional information)
As I thought - the problem was Crystal Reports was not recognising the JOIN when displaying the parameter values.
After some reading, I found out that the JOINS are only recognised when the query is passed to the database (logically). So when selecting a Parameter, it doesn't recognise the JOINS.
I got around this by creating a custom SQL command, forcing it to only pull back the groups in the second table.
First, please confirm your join INNER JOIN.
For Addition,
You can pass the User Input as a parameter in to the crystal report and use this {#Parameter} to filter the result set using SelectionFormula in Crystal Report.
Or you can even set the selectionformula itself from the application.

SSRS 2014 : Add several cells inside of a large cell

I have created a table like below. The table use a dataset
I want to add several cells within one of the row like below and be able to query through the same dataset and most of all, be able to leave the other rows intact (see below).
Issue is I cannot do it within the table.
One of my workaround solutions, which is not satisfying to me , is to to create a rectangle then add another table / matrix within that rectangle (like I did in the image above). Then superimpose the rectangle in one of the cell of the table / matrix I want to split. However, when I'm deploying the report, I have an error tablix ‘Tablix15’ has a detail member with inner members. Detail members can only contain static inner members
The other solution is to create several columns then merge the cells of the rows I don't need and keep the cells I want. Drawback : Very tedious and lacking of flexibility
If you have any ideas on how to do it or fix the error above, I'm all ears.
Thanks!
Satisfying or not - the solution is to create a rectangle in the cell and add tablixes to this rectangle for the extra columns.
You are getting the detail member with inner members error as I imagine you are probably nesting Row Groupings.
Consider this example, showing a nested table.
When run like this I get the following error, exactly as you do above
The tablix ‘Tablix8’ has a detail member with inner members. Detail members can only contain static inner members.
This static inner members it refers to is saying that it isn't going to allow you to do more grouping at this lower level. This should be fine though based on the information you presented in the question, as you only want the values for this specific Row. Therefore, to remove the grouping, right click the Row Header, select Row Group -> Delete Group and then select Delete Group Only.
Note the (three lined) = symbol has disappeared from the Row header. When this report is then set to Preview, it now renders as expected
Hopefully this will solve your issue. Please let me know if you have further problems or queries on this.

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.

SQL 2005 Report Designer - Using specific table cells as data in charts

I have various reports built in MS SQL 2005 Report Designer, displaying various sums and counts of different data. Now I need to implement different types of charts in these reports (Bar graphs, Pie charts), using the data from the summed cells (subtotals and grand totals for groups).
I don't see any ways to specify a table cell as input for a chart's data in the chart properties, it gives me errors saying it's not part of the "data region." I can't find any info on how to create data regions, and I assume I don't want to use "data output" because that only deals with exporting xml?
Can anyone give me some direction on how to easily link table group subtotals to chart input data?
Thanks
Different report items (tables, chart, etc) don't have to derive from the one dataset. Just use different datasets for the different report items. Let's say your main report table uses a dataset that shows the invoices sent by different branches, which you sum at the branch level:
SELECT Branch, InvoiceNumber, InvoiceDate, InvoiceAmount
FROM Invoices
ORDER BY Branch, InvoiceNumber
Simply create another dataset for the pie chart being the summary information:
SELECT Branch, SUM(InvoiceAmount) AS BranchSum
FROM Invoices
GROUP BY Branch
you want to create a expression calling on the dataset
=Sum(Fields!InvoiceAmount.value, "DataSet1")
If you want to call on the same Field just use AS in the select statement.
Select
Invoices.InvoiceAmount AS InvoiceAmt
InvoiceAmt will then be a useable field equal to invoiceamount

Resources