Working with Stepped and Block Format with SSRS

Home > Blogs > SQL Server > Working with Stepped and Block Format with SSRS

Working with Stepped and Block Format with SSRS

Like This Blog 3Peter Avila
Added by October 11, 2013

There are two ways you can format grouped data in a table data region in SSRS: You can use the stepped format or the block format. I’ll show you an example of each, how to create them, and then how to convert a group from one format to the other. I’ll also introduce group columns, show you how the presence of a second group column can have an undesired side-effect when converting from block format to stepped, and then show you how to remove the side-effect. To close out, I’ll show you a false solution to the second group column issue that you will want to avoid.

Let’s get to know the two formats, first. From a design perspective, the difference between the two is very simple: The group header row is present in the stepped format and absent in the block format. Here’s a report using the stepped format. Notice that the group header row, though empty, is present. Also notice that the detail rows start below the group header row, creating a “step” from the header row to the first detail row.

001-Stepped-and-Block-Formats-in-SQL-Server-SSRS

Now here’s the same report in block format. Notice that there is no group header row, and so the detail rows can occupy its space, eliminating the “step” and creating a “block” effect:

002-Blocked-Formats-in-SQL-Server-SSRS

Unless you are including data in the group header row (we see a good example of this in the BI779 course when doing drill-down), you will probably want to use the block format.

Those are the two formats. Let’s have a look at how to create each one and then how to convert a group from one format to the other.

Create a Group in Stepped Format

To use the stepped format when creating a group, just select the Add group header option.

You may also like:  How to Display the Elapsed Processing Time of a Report in SSRS

003-add-group-header-in-SQL-Server-SSRS

Create a Group in Block Format

To use the block format when creating a group, just leave the Add group header option unselected.

004-add-group-header-in-SQL-Server-SSRS

Converting from Stepped to Block

Converting a group from stepped format to block format just means deleting the group header row. Right-click in any textbox in the group header row and select Delete Rows.

005-delete-rows-add-group-header-in-SQL-Server-SSRS

Convert from Block to Stepped

Converting a group from block format to stepped format means inserting a group header row. If your report has more than one group column, you’ll have to make an additional adjustment. Group columns are the ones to the left of the double-dotted vertical border.

To insert the new group header row, right click in any group column textbox and select Insert Rows and then Inside Group – Above. The figure below shows a right-click on the Order Date column textbox, but we could have just as well selected the textbox for the SalesOrderNumber column. The results would have been identical.

006-insert-rows-add-group-header-in-SQL-Server-SSRS

Notice a couple of things. First, we can confirm that the new row is a group header row and not, say, a second detail row; the row selector symbol on the left side of the table tells us that. Second, it looks like the Order Date has been pushed down a row!

007-group-rows-add-group-header-in-SQL-Server-SSRS

What’s going on? SSRS always creates the header row all the way back to the first group column regardless of how many other group columns there might be; it just pushes those other columns down and out of the way. The remedy to this side-effect is a bit clunky. Fortunately, it’s also very simple. We’ll just need to merge the two textboxes in the Order Date column and then re-link the resulting textbox to the data.

You may also like:  Microsoft Second Shot Exams Are On!

To merge the two textboxes, select both together, right-click in the selection, and then select Merge Cells.

008-merge-cells-group-header-in-SQL-Server-SSRS

To re-link the textbox to the data, hover over the resulting textbox until you see a small, list icon in the upper right corner of the textbox. Click that icon and select the column you want—in this case, Order Date.

009-merge-cells-group-header-in-SQL-Server-SSRS

Fixed!

010-order-date-fixed-cells-group-header-in-SQL-Server-SSRS

And you’re back in business!

A Word of Caution

When converting from block format to stepped format, you might discover that if you insert the new row from one of the detail textboxes instead, the Order Date doesn’t get pushed down. This might seem like an easier solution at first, but it isn’t!

011-order-date-fixed-cells-group-header-in-SQL-Server-SSRS

While it’s true that the Order Date does not get pushed down, have a look at the row selector symbols on the left side of the table.

012-detail-row-symbol-in-SQL-Server-SSRS

We just inserted a new detail row and not the group header row that the stepped format requires. And it makes perfect sense when you think about; we inserted from a detail textbox, and we selected “Inside Group.” In other words, we were in a detail group so we got a new detail row.

After formatting the Order Date textbox to “d” for small date, the report looks like this, clearly not the desired format in this case:

013-order-date-detail-row-symbol-in-SQL-Server-SSRS

The correct way to remove the side-effect is to insert using the group column textboxes as shown above.

Enjoy!
Peter Avila
SQL Server Instructor – Interface Technical Training
Phoenix, AZ

Videos You May Like

Agile Methodology in Project Management

0 21 0

In this video, you will gain an understanding of Agile and Scrum Master Certification terminologies and concepts to help you make better decisions in your Project Management capabilities. Whether you’re a developer looking to obtain an Agile or Scrum Master Certification, or you’re a Project Manager/Product Owner who is attempting to get your product or … Continue reading Agile Methodology in Project Management

Creating Users and Managing Passwords in Microsoft Office 365

0 30 1

In this Office 365 training video, instructor Spike Xavier demonstrates how to create users and manage passwords in Office 365.

Detailed Forensic Investigation of Malware Infections – April 21, 2015

1 80 1

In this IT Security training video, Security expert Mike Danseglio (CISSP / CEH) will perform several malware investigations including rootkits, botnets, viruses, and browser toolbars.

Write a Comment

See what people are saying...

  1. Faiz

    Awesome!! Great Article, helped me a log in understanding difference between Block vs Stepped.

    Thank you so much!!

  2. Pingback: How to Implement Expand All/Collapse All for Drill-Down in SSRS

  3. Dev SSRS

    Good tutorial, thanks.
    May be you can write something about Group Visibility and Toggle.

    Dev SSRS from http://blog.yvoz.net/

Share your thoughts...

Please fill out the comment form below to post a reply.