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

2

1

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.

Estovers answered 13/10, 2009 at 16:43 Comment(2)
That seems like an odd way to format something that looks to make sense in the standard table. Is this purely aesthetic? Could you explain a little more about why the second side by side grouping makes sense? If theres not a data related way to group, it will make things very difficult.Cursorial
I'm trying to create a report that can be printed directly to a sheet of labels (I know, I know, but those are the requirements I was given!). There are 2 columns of labels.Estovers
E
4

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.

Estovers answered 14/10, 2009 at 13:27 Comment(0)
C
0

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?

Cursorial answered 13/10, 2009 at 16:47 Comment(6)
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?Estovers
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.Cursorial
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....Estovers
on the properties of the table, are any "insert page break" options checked?Cursorial
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.Estovers
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.Cursorial

© 2022 - 2024 — McMap. All rights reserved.