简体   繁体   English

如何在SSRS中的列中显示数据

[英]How to show data in column in SSRS

I'm using SSRS for my reporting, my reporting solution is in Visual Studio 2008 Business Intelligence Development Studio. 我正在使用SSRS进行报告,我的报告解决方案是在Visual Studio 2008商业智能开发工作室中。

I have a report in which the data should be displayed in this format. 我有一份报告,其中数据应以这种格式显示。

在此输入图像描述

I have added a Column Group in my table which is having the values of Customer Name and details, the data is coming fine in the vertical format ie column after column. 我在我的表中添加了一个列组 ,其中包含客户名称和详细信息的值,数据在垂直格式即列后一列正常。

My Issue : 我的问题:

There should be only three columns in each row, after three records the next row should begin and again not more than three records should be displayed as shown in the image above. 每行应该只有三列,在三个记录之后,下一行应该开始,并且应该再显示不超过三个记录,如上图所示。

My attempts : I tried to add a row group and in that gave the expression 我的尝试:我试图添加一个行组,并在其中给出了表达式

= Ceiling(Fields!Row_Count.Value/3) here Row_Count is a field which is coming from my query which holds the serial number of the records. = Ceiling(Fields!Row_Count.Value/3)这里Row_Count是一个来自我的查询的字段,它保存记录的序列号。

My SQl Query 我的SQl查询

SELECT Row_Number() over(order by table_ID) AS Row_Count, Field_1,Field_2 from MyTable

In my Column group i have Customer Name and in my Row Group i have other details of the customer. 在我的专栏组中,我有客户名称 ,在我的行组中,我有客户的其他详细信息。 The data is getting populated column wise but the issue is its not breaking the current row after three records. 数据按列填充,但问题是它在三条记录之后没有打破当前行。 Below is my table of report. 以下是我的报告表。

在此输入图像描述

You were on the right track. 你走在正确的轨道上。 Say you have data like this: 假设你有这样的数据:

在此输入图像描述

I have created a tablix like this: 我创建了一个这样的Tablix:

在此输入图像描述

The Row Group expression is: 行组表达式为:

=Ceiling(Fields!Row_Count.Value / 3)

This works together with the Column Group expression to split over three columns: 这与列组表达式一起使用以分割三列:

=(Fields!Row_Count.Value - 1) Mod 3

The other thing to note compared to your tablix is that CustomerName is not in a table header row, but rather there are two row header rows, one for CustomerName and one for Details . 与Tablix相比,另一件需要注意的是CustomerName 不在表头行中,而是有两个行标题行,一行用于CustomerName ,另一行用于Details

This is looking OK to me, obviously you can format to taste: 这对我来说很好看,显然你可以格式化:

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM