SSRS. How to merge cells using expressions?

I have 3 columns and here are 2 possible ways:

1. In all of them are values 
2. Only col1 keeps value (col2 and col3 NULL)

For now It looks like:

| col1 | col2 | col3 |
----------------------
| val1 |      |      |
| val2 | val3 | val4 |
| val5 | val6 | val7 |
| val8 |      |      |

It should be like this:

| col1 | col2 | col3 |
----------------------
|        val1        | -- merged cells, because col2 and col3 empty
| val2 | val3 | val4 |
| val5 | val6 | val7 |
|        val8        | -- merged cells, because col2 and col3 empty

I don't have idea If I need to create groups (I've tried row/column grouping, but really unsuccessfully, far away from what I need).

As I think I need to write expression something like:

IFF(col2 & col3 = NULL) MERGE(col1, col2, col3)

Just I can't get success with expression's structure.

August 27th, 2015 10:03am

Hi Santoshkum,

 The ColSpan property can't be changed using an expression however you might be able to accomplish the task by creating a second row within the row group, then use an expression to hide the merged rows when condition is false.

Please have a look on the following thread for more info.

http://social.msdn.microsoft.com/Forums/is/sqlreportingservices/thread/19c4d207-bc9c-459b-9220-421a1b580207

Free Windows Admin Tool Kit Click here and download it now
August 27th, 2015 10:57am

Hi santoshkum,

In Reporting Services, we can only merge cells in design surface, its not supported to merge cells dynamically during report processing time.

In your scenario, you can insert two rows outside the group, then merge the cells to make those two rows contain one cells. Specify the value for the first row with First() function, the last row with Last() function. Please refer to screenshots below:

If you have any question, please feel free to ask.

Best regards,
Qiuyun Yu

August 28th, 2015 2:12am

i am generating a report like this(calculating subtotal & total in sql code itself)

Sl. No.

State

District

count

1

ap

North 

                     280,527

2

up

Behar

                     227,096

.

Sub Total

.

                       72,653

.

Total

.

                       60,616

but i need report like this

Sl. No.

State

District

count

1

ap

North 

                     280,527

2

up

Behar

                     227,096

Sub Total

                       72,653

Total

                       60,616

How can i achieve it..................................


  • Edited by santoshkum Friday, August 28, 2015 5:24 AM
Free Windows Admin Tool Kit Click here and download it now
August 28th, 2015 5:23am

HI Santosh,

For the above requirement.

If u know the way , how to merge the excel data cell in ms excel, I the same way we can do it for this one also..

I the same way u can merge the text box cells also..

August 28th, 2015 8:28am

Hi santoshkum,

In your scenario, you can click the first cell in "Sub Total" row then hold the left mouse button down, drag vertically horizontally to select adjacent cells, then right click the selected cells and select Merge Cells.

Reference:
Merge Cells in a Data Region (Report Builder and SSRS)

If you have any question, please feel free to ask.

Best regards,
Qiuyun Yu

Free Windows Admin Tool Kit Click here and download it now
August 30th, 2015 3:41am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics