How can I display two rows worth of data on one line side-by-side in Report Designer?

前提是你 提交于 2019-12-23 02:31:53

问题


I am using SQL Server Reporting Services 2005, and I'm developing a report in Report Designer/Business Intelligence Studio. Right now I have a normal-looking table that displays data like this:

----------------
| A  | B  | C  |
----------------
| A1 | B1 | C1 |
----------------
| A2 | B2 | C2 |
----------------
| A3 | B3 | C3 |
----------------

What I would like to do, is display two rows side-by-side on the same line, so that the table would look like this:

-------------------------------
| A  | B  | C  | A  | B  | C  |    
-------------------------------
| A1 | B1 | C1 | A2 | B2 | C2 |
-------------------------------
| A3 | B3 | C3 | A4 | B4 | C4 |
-------------------------------

Is this even possible? Does anyone know how to accomplish this? Google searches have turned up nothing for me so far. Thanks in advance for any help.


回答1:


Ok, I figured out how to do what I wanted. I created a table with 2 (repeating) table detail rows, with the following values:

--------------------------------------------------------------------------------------------------------------------------------------------
| =Previous(Fields!A.Value) | =Previous(Fields!B.Value) | =Previous(Fields!C.Value) | = Fields!A.Value | =Fields!B.Value | =Fields!C.Value |
--------------------------------------------------------------------------------------------------------------------------------------------
| =Fields!A.Value           | =Fields!B.Value           | =Fields!C.Value           |                  |                 |                 | 
--------------------------------------------------------------------------------------------------------------------------------------------

Then I went to the properties of each row, and set the "hidden" value to an expression. For the first line I used this expression:

=Iif(RowNumber("table1") mod 2 = 0, false, true)

For the second line, I used this expression:

=Iif(RowNumber("table1") = CountRows("table1") AND RowNumber("table1") mod 2 = 1, false, true)

That did the trick. It now displays how I wanted.




回答2:


You would need a matrix report.

eidt: although now that I think about it that would probably only be able to get you to something like this:

|        A1       |      B1         |          C1      |
-------------------------------------------------------
|  A  |  B  |  C  |  A  |  B  |  C  |   A  |  B  |  C  |

Would that format work for you?



来源:https://stackoverflow.com/questions/1561464/how-can-i-display-two-rows-worth-of-data-on-one-line-side-by-side-in-report-desi

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