在SQL Reporting Services中分组问题

时间:2022-05-26 07:41:32

I haven't worked with SQL Reporting much, however I have been trying to get my results to appear in a specific way but I just can't seem to figure out how to format / group my results.

我没有太多使用SQL报告,但是我一直试图让我的结果以特定的方式显示,但我似乎无法弄清楚如何格式化/分组我的结果。

The data that I am receiving from my query resembles the following:

我从查询中收到的数据类似于以下内容:

  • ID Number (This is what the items will be grouped by)
  • 身份证号码(这是项目的分组方式)

  • Display Name (Corresponds to ID Number 1:1)
  • 显示名称(对应于ID号1:​​1)

  • Study Date/Time (Studies have a many-to-one relationship with ID Numbers)
  • 研究日期/时间(研究与ID号有多对一的关系)

  • Study Description

Basically, I am trying to format my results as follows:

基本上,我试图将结果格式化如下:

DISPLAY NAME (NUMBER OF STUDIES)
---------------------------------------------------------------------------------
STUDY DATE / TIME           |  STUDY DESCRIPTION                                 
----------------------------+----------------------------------------------------
01/16/2012 12:34 AM         |  EXAMPLE DESCRIPTION 1
02/22/2012 02:22 PM         |  EXAMPLE DESCRIPTION 2

I have tinkered with the grouping several times I am able to have the name appear on the left-hand side and list all of the studies to the right, however I am trying to achieve the appearance listed above but am not having any luck.

我已经多次对分组进行了修改,我可以将名称显示在左侧并列出右侧的所有研究,但是我试图实现上面列出的外观但是没有任何运气。

Any suggestions would be more than welcome and I will try to provide any additional details if needed.

任何建议都会受到欢迎,如果需要,我会尝试提供任何其他详细信息。

1 个解决方案

#1


2  

  • Group by ID Number.
  • 按ID号分组。

  • Include two group header rows - one for Display Name and count of rows, one for column headings.
  • 包括两个组标题行 - 一个用于显示名称和行数,一个用于列标题。

  • Include a detail row to list study date/time and description.
  • 包括详细信息行以列出研究日期/时间和说明。

  • You may want to include a group footer with a space in it, to insert a blank line between one group and the next.
  • 您可能希望在其中包含一个空格的组页脚,以在一个组和下一个组之间插入一个空行。

#1


2  

  • Group by ID Number.
  • 按ID号分组。

  • Include two group header rows - one for Display Name and count of rows, one for column headings.
  • 包括两个组标题行 - 一个用于显示名称和行数,一个用于列标题。

  • Include a detail row to list study date/time and description.
  • 包括详细信息行以列出研究日期/时间和说明。

  • You may want to include a group footer with a space in it, to insert a blank line between one group and the next.
  • 您可能希望在其中包含一个空格的组页脚,以在一个组和下一个组之间插入一个空行。