views:

441

answers:

2

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.

A: 

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?

kscott
No, that wouldn't do it. What I'm wondering is if there's perhaps a way to put 2 tables side by side, and filter them so that they only show every-other row. So the first table would have rows 1, 3, 5, etc, and the second table would have rows 2, 4, 6, and so on. Is there a way to do that?
Joshua Carmody
What is the data source of this report? You'd need something in the data to key in on. For example, if its a sql table with an identity key you could make one table show odds and one show evens, or something like that. You can have two side by side tables, just make each use a different query to populate the data.
kscott
Ok, I've found a way to make a table only display odd or even rows. But, when I try to put 2 tables side by side the right-most table ends up on the next page for some reason....
Joshua Carmody
on the properties of the table, are any "insert page break" options checked?
kscott
Nope, all the "page break" options are unchecked. For the tables, the grouping options, etc. Oddly, the second table only seems to get pushed down if the first table doesn't fit on the page. When the table is shorter, they display properly side-by-side.
Joshua Carmody
thats not odd, how else could it grow and shrink with the data? It's like any other wrapping function, if the thing to the left is too long, the thing to the right gets wrapped. You would need to set the CanGrow and CanShrink attributes to false if you want a statically sized table or field. However, if your goal is printing labels, you might end up with truncated data on a label.
kscott
+2  A: 

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.

Joshua Carmody