Blank out duplicate column values in SQL Reporting Services

拈花ヽ惹草 提交于 2020-04-04 06:48:09

问题


This has to be stupid easy to do, but I'm not seeing it.

I have a SQL Reporting Services (SQL 1008 R2) report.

I'm using a tablix to basically show:

COL 1 |  COL 2 |  COL 3 |  COL 4
----------------------------------
100   |  100   |  100   |  Item 1
100   |  100   |  101   |  Item 2
100   |  100   |  102   |  Item 3
100   |  110   |  110   |  Item 4
100   |  110   |  110   |  Item 4
100   |  110   |  111   |  Item 5
100   |  110   |  112   |  Item 6

But I want to suppress repeating values in those first two columns so it looks like this:

COL 1 |  COL 2 |  COL 3 |  COL 4
----------------------------------
100   |  100   |  100   |  Item 1
      |        |  101   |  Item 2
      |        |  102   |  Item 3
      |  110   |  110   |  Item 4
      |        |  110   |  Item 4
      |        |  111   |  Item 5
      |        |  112   |  Item 6

I thought it might be as easy as right clicking the column and selecting "Hide duplicate values", but I'm not seeing that. I'll apologize now because I'm going to feel stupid when someone points out how easy it is to do or find.


回答1:


It is probably best to simply use groups, but if you want to keep it this way, try:

=IIf(Previous(Fields!Col1.Value) = Fields!Col1.Value, Nothing, Fields!Col1.Value)

Or you can set the textbox's HideDuplicates property to the containing group name (in your case, presumably Tablix1_Details)



来源:https://stackoverflow.com/questions/12940805/blank-out-duplicate-column-values-in-sql-reporting-services

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