5

I have several SSRS reports to create for a client that need to have a table layout. I know that some people frown on using the Tablix only for this purpose, but trying to align rectangles and other controls is extremely time consuming.

Many of these tables have over 50 rows (with multiple columns) and I constantly need to perform the sequence "Right-Click >> Insert Row >> Below". This is extremely repetitive and I would like to know if anyone knows of a better way to accomplish the task.

I tried to find a similar question on SO, in addition to Googling a possible solution, but I was unable to locate someone with my exact question that had a solution.

One option I've tried was to create my own keyboard shortcut using the custom shortcuts in VS2008 options. There are four possible options that do not have a shortcut assigned:

  • OtherContextMenus.RowColumn.InsertRowAbove
  • OtherContextMenus.RowColumn.InsertRowAbove
  • OtherContextMenus.RowColumn.InsertRowBelow
  • OtherContextMenus.RowColumn.InsertRowBelow

Unfortunately, I my attempt to map either of the four commands was unsuccessful. If these are the commands, and someone has successfully accomplished what I am trying to do, please let me know. If these commands do not apply to the Tablix designer, does anyone else have a solution that works for them?

Edit: The main report on which I will be using this table only populates a couple textboxes at the top of the page. The table itself does not contain any data and is used to hold student's grades. The 50+ rows are categories that are graded and there are 12 columns representing the students in the class.

GibsonCode
  • 89
  • 2
  • 13
  • I think you may have an [XY problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem) here: *why* would you need 50 rows? It may help if you tell us about your dataset and what the reasoning behind all this is, and we might be able to help you with that. – Jeroen Feb 06 '13 at 20:06
  • @Jeroen There is no dataset. The reason I am using SSRS is because a small section at the top of the page needs to be populated with data. The actual Tablix will not be populated with any data, but I wanted to avoid having to organize 600+ textboxes in a layout that is basically in table form. – GibsonCode Feb 06 '13 at 22:20

1 Answers1

8

I agree with your basic approach - a table is a much easier way to control the layout.

To quickly copy rows, right click the report in the Solution Explorer and choose View Code. Find the TablixRow XML node in your table you want to copy, and then Copy and Paste it as many times as needed. Make sure you copy the entire node from start to end tag.

Tip - use the expand/collapse toggles on the left to collapse your source TablixRow XML node before you copy it - helps avoid copy errors.

Obviously make sure you have a backup of your report in case you screw this up!

Mike Honey
  • 14,523
  • 1
  • 24
  • 40
  • 1
    This works perfectly! Thanks for the tip; I would have never thought to use the XML code to accomplish this. – GibsonCode Feb 07 '13 at 14:24
  • 1
    New to SSRS, this is so helpful! – clweeks Jun 04 '15 at 14:57
  • 1
    I just tried this solution and when I copied the rows in code the text box names within the table rows don't auto rename like they do if you copy a control in say ASP.net. I ended up spending far more time than I would right clicking and hitting insert row below just renaming the embedded text boxes that were copied along with the rows. :-( – Hunter Nelson May 12 '16 at 18:48
  • 1
    This is great, thanks! Also, it's another reason I get mad when my team mates leave their controls with default names. "Tablix19" is awful. Name it and it's easier to find! – CaptainMarvel Jul 18 '17 at 13:12