SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Report Builder 3.0 - Merging cells vertically in a table


Report Builder 3.0 - Merging cells vertically in a table

Author
Message
bmahf
bmahf
SSC Veteran
SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)

Group: General Forum Members
Points: 275 Visits: 79
I am trying to create a table with some cells merged vertically. The table is static, and is therefore not expected to grow with the incoming data. I have set the dataset for the table to be a dummy dataset that just creates one row with no content (select ''). I am going to get data into one cell in each of the rows by using separate datasets per row doing individual calls to the database, therefore my expression for each would be =First(Fields!MyField.Value, "DataSet1"), or "DataSet2", etc. The rest of the cells in each row (to the left of the data value) will each contain static, known values, as row headers.

For some of the row headers, say for rows 2 and 3, I am needing to merge the first cells vertically and the third cells vertically. The second and fourth columns will not be merged. Although this is not a standard way for Report Builder 3.0 to be used, this is definitely a standard form for my industry, and cannot really be changed. And I have been tasked with replicating this in RB3.

So, as a very simple example, I might have four rows with four columns looking like this:

Exercise1   10 miles   3 secs      <Data from DataSet1>
Exercise2 20 miles 5 secs <Data from DataSet2>
Exercise2 30 miles 5 secs <Data from DataSet3>
Exercise3 40 miles 4 secs <Data from DataSet4>



So Exercise1 will not be merged, the first and third cells of each row for Exercise2 will be merged, and Exercise3 will not be merged. It should look like this, in table layout:

Exercise1   10 miles   3 secs      <Data from DataSet1>
Exercise2 20 miles 5 secs <Data from DataSet2>
30 miles <Data from DataSet3>
Exercise3 40 miles 4 secs <Data from DataSet4>



Does anyone have any advice on how to merge these cells vertically. I have tried this table a number of ways, and layout has not been good. I looked at the Microsoft doc page (http://msdn.microsoft.com/en-us/library/dd239384(v=sql.110).aspx), and under the section labeled "Controlling the Appearance of Data", there's a bullet point labeled Merging Cells that explicitly states:

"Multiple contiguous cells within a table can be combined into a single cell. This is known as a column span or a cell merge. Cells can only be combined horizontally or vertically."

So supposedly I can do the vertical merge, but I haven't figured out how.

I have tried selecting cells vertically, even when they belong to rows that are of the same group, and when I right-click the Merge Cells option doesn't show up, as it does when I select cells horizontally and do the same thing. I have looked further into the online documentation but haven't yet found a place where they explain what I'm doing wrong.

Any help on this would be highly appreciated.
bmahf
bmahf
SSC Veteran
SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)

Group: General Forum Members
Points: 275 Visits: 79
Well, I was really hoping someone had a suggestion for me here. What I ended up doing was creating an outer table, and, for rows that had vertically spanning cells, I used only one row, merged all cells horizontally that didn't span vertically, and placed tables with as many rows as I needed so that the one cell which in the report spans vertically is represented by a single cell in the outer table, but the inner tables make it look like to its right and left there are two to three rows associated with it. I was able to do this because of the fact this is a statically defined table, always the same height, and the decision had already been made (not my decision) to make separate datasets for each row of the table.

So that works. Each row of the table makes a string reference to First() of the dataset it's using (since there's only one row returned from any of these datasets, that's fine). The web rendering is much better in this case than without the outer table.

Now I'm running into alignment issues within the table defined. Any table that has tables inside of it has rows in the web rendering that push out further to the right and those that push out a few pixels less to the right. Turns out that it's the rows that weren't merged and fitted with inner tables that are slightly wider than those that were.

Also, for those rows that were merged and fitted with an inner table, their columns in the web rendering push down a pixel or so less than those that weren't.

I've been able to reduce some of these differences by turning off some borders. Wherever, in the line of extra growth, I see two cells sharing an inner border (a light gray border inside the table boundaries) I choose one of them to turn off. Turns out that turning off the one in the cell belonging to the inner table seems to be the better choice.

This has helped some too, but now I have some gaps in the web rendering between cells where the border from the adjacent cell doesn't quite reach and touch this cell's border. And there's still some extra growth in rows mostly, but also in columns.

Quite maddening this. I continue to look at it, but I'm not really sure how to fix it. Any ideas guys? Right now I need a miracle to fix this thing.

P.S. - the print rendering continues to be perfectly ok.
Mackers
Mackers
Say Hey Kid
Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)

Group: General Forum Members
Points: 671 Visits: 499
I would say that you've posted this in the SSAS bit of the forum not the Report Builder/Reporting Services bit. You might get more response there

Mack
bmahf
bmahf
SSC Veteran
SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)SSC Veteran (275 reputation)

Group: General Forum Members
Points: 275 Visits: 79
Thanks Mack
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search