SSRS - Is it possible to have detail rows under a parent row

半城伤御伤魂 提交于 2019-12-24 14:34:54

问题


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


回答1:


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:




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/4826391/ssrs-is-it-possible-to-have-detail-rows-under-a-parent-row

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!