I have a report that currently lists data of a parent and its the details on the same row. So lets say the columns of the parent group take up the first three columns and the details the next three. Currently the first three columns span the height of the combined details rows. So if there are three detail rows the first three columns are one row that spans the height of these three columns. This is how I initially wanted it.
Now what I would like to do is list the first row of the parent group, then under that list the details, then the next row of the parent group and under that its details and so on.
An example just in case i'm not clear
CategoryId and Category Name are the parent columns
ProductId ProductName and Price are the details, and these are linked to the category by a categoryId
I want to display the first category row, then under that each product in this category, then the next category row and under it the products, then the next category etc.
Is this possible?
Thanks,
Neil
What you are looking for is called a stepped report. Here is a good guide on how to create one in SSRS 2008: How to: Create a Stepped Report.
From the webpage:
A stepped report shows detail rows or child groups indented under a
parent group in the same column, as shown in the example below:
I believe you are asking for:
Category 1 | Category A
Product A01 | $1
Product A02 | $2
Category 2 | Category B
Product B01 | $1
Product B02 | $2
You could try placing the matrix/table in a list which is grouped by category
List grouped by category id[
Table header row [ category id | category name ]
Table detail row [ productname | product price ]
]
Hope that makes sense. I predominately use SSRS2005 where there are many shortcomings like this (I put tables in lists and header tables in table cells etc etc). SSRS2008 could have another solution.
I opted for a solution using sub-reports. So I display the first three columns on the first row, then on the next (repeating) row I have a sub report which takes the categoryId and displays the products based on the ID passed into it. Works as I want it to
Related
How can I want print the same field twice with different value for each?
My Product and Shop tables are linked with product_id as the primary/foreign key.
Product
product_id
product_name
Shop
shop_id
product_id
quantity_product
When I use Expert Selection, I take all products on Shop_id 1 and Shop_id 2 (if Shop_id is in {1,2}...). Now I want to print 2 different quantity_product fields from Shop 1 and Shop 2 in the same line as my product_id. Something like:
product_name quantity_product(shop_id: 1) quantity_product(shop_id: 2)
1 10 20
I tried adding a new link in my database scheme with another Shop table, but it didn't work out.
You can set up a CrossTab in the summary section to handle any number of Shops. (So long as there's room on the report for all the shop columns)
If that doesn't work you can manually set up a summary for each Shop:
Keep in mind both of these solutions will need to be placed in a Footer section instead of the Details.
I have a table that contains students' results. These results are generally broken into four types: term1, term2, term3 and term4. So over a year, a student may have up to four records in that table containing his results.
I want to create a layout that contain a portal that will show all the 4 records in a single portal row. Is there any way to do this? Or any workaround?
The reason why I do not want to display the records as four rows in the portal is because there are different subjects and will not be right if each subject occupy four rows and there are many subjects a student may take.
I can think of two ways to approach this, both of which would require a relationship from your Results table occurrence to another table occurrence based on Results, let's call it Results~SameStudentID. (The matching field would the foreign key to the Student table, FK_StudentID = FK_StudentID.)
Create 4 calculation fields in your Results table: Result_1, Result_2, Result_n, etc. The formula to use for each of the calculation (starting from the context of the Results table occurrence) would be:
GetNthRecord ( Results~SameStudentID::Result ; n )
Then, simply include the 4 "Result_n" fields in your portal
Create just one field, Results_1_4, with the following formula:
Substitute ( List ( Results~SameStudentID::Result ) ; ΒΆ ; " " )
Is it possible to have add a row to an SSRS 2008 Matrix that spans all of the matrix's columns?
This crude diagram shows roughly what I'm looking for:
The basic idea is that each line item is a person, and each column is a field in a form for that person. The fields themselves are dynamic (and implemented as column groups on the matrix). Additional column groups are included to append non-dynamic form fields, like the time the record was entered and who entered it. Under each person's record is a comments field, which should span all of the form fields above it.
At the moment I have the matrix embedded in another tablix, with the name and fields in the matrix and the comments in the parent tablix. This works for the data (each instance of the matrix ends up being one row), but the header repeats too often (once per person) because it's attached to the matrix. The only thought I have as to how to fix this is to create another matrix in the parent tablix with the same grouping and use it to display the headers... But this will require quite a lot of manual synchronization to keep the two matrices the same.
Edit: The key problem here is making the second row span multiple column groups.
Here's what you can do:
Select the column grouping you want to add above and right click and select
Add Group... Parent Group...
Group the column by something that will not aggregate the data. You'll have to select a field from your dataset to group by so that it creates an overlapping column grouping.
Check the Add group header box
You should now see something similar to this:
Now you just need to move the Value1 field and it's header over under the new column to the right beyond the matrix dividers. Once that's done, simply delete the ungrouped column where you just copied Value1 from and be sure to select Delete columns only checkbox.
Your finished product should look like this:
It is possible - And the above answers are partial answers leaving out one key step: Merging the cells of the child row.
First, right click on your grouped row, then select Insert Row -> Inside Group - Below and you will get two rows with the cells aligning on the columns
Second, ctrl click all the cells in your new row (ie row without the data) then right click on one of the highlighted cells, and then select Merge Cells.
Now you have the table you like. To add a value to the new row: first right click your new (multi column) cell,select Create Placeholder, and then add the dataset item you desire to the placeholder.
[Edit]
After several attempts, I'm going to say this isn't possible in SSRS. The best I could come up with is a group footer that spans columns 1,2, and 3, but not the User column.
[Original Response]
I recently did something similar to this.
First, what tool are you using to create SSRS reports? (I used SQL Server Business Intelligence Development Studio)
You'll want to create a row group (grouped on Person)
Append a row to your table in "Design" view (Right click, "Insert Row --> Inside Group - Below").
Add an expression to the row that pulls the value for your "Comment" column (=Fields!Comment.Value).
Let me know if that helps...
Try adding in you column group "header" with a grouping expression of (1=1). Then a detail field will need to be defined. If you define the other group with correct data then the "header" will stretch across all details columns. You may need to merger depending on other options.
The easiest way to do this is to create a Tablix with only one column, and your row grouping.
Then, you create two rows inside this group.
In the first row inside the group, you insert a Matrix, wich you can then subgroup as you prefer.
I just had a similar problem, and this was my solution.
I banged my head against the wall for a lot of time, until i realized the solution to my problem wasn't "making a cell span multiple column groups", but "making a cell split into multiple column groups".
You can accomplish the goal by using a subreport for each person. The subreport will receive the employee id and create the hierarchy for you. Make sure your subreport column widths match the widths of the parent report.
I have a report that joins multiple tables. One possibility for this join is that no rows are returned under part of the selections criteria. Sort of.
I have 3 groups: Movie Rental Place, Type of Movie, Rented / Not Rented / No Interest to Rent.
So an example could be:
Blockbuster | Comedy | Rented: List rented movies.
Blockbuster | Comedy | Not Rented: List movies not rented.
Blockbuster | Comedy | No Interest to Rent: List movies not interested in renting.
Now, I do not want to suppress a section if it is empty, I want to print something else in the Details section of CR. Is there a way to do this?
I am using CR 11.5.
Thanks
Go to Section Expert and check the "Suppress blank section" option. Add a new section below it (for the static message) and add a suppress formula to that section that uses some isnull check on whichever column indicates "no data".
Before, when I was attempting to create a custom formula for the Details section, I was testing on NULL values, when the report was setup to give default values for NULL values. Once I removed that, things worked as intended.
Thanks
If I had a single table of items ordered (let's call the table "items"), and there was a column within the table that tied the items in the same order together (order_id), how would I select all orders that contained a certain "key" item?
In other words, I want to select orders that contain the "key" item and I want to see all the items with in that order, not just the "key" item.
For example, I want to select all grocery orders (and all the items within) where the person at least ordered "apples".
You could probably (although I haven't tested it):
Add your table twice (so you will have two aliases pointing to the same table: table_1, table_2), joining on order_id
In your selection formula, use {table_1.key} = "apples"
Add a group on {table_1.order_id}
Use fields from table_2 for the detail section
Alternatively, add the table once, select on {table.key} = "apples" and group by {table.order_id}. Add a subreport in the group header linked by {table.order_id} to display the items. This will be slower, but it will definitely give you what you want.