Tag Archives: SSRS

How to avoid cell merging when exporting to Excel in SSRS 2008

Have you had problems with merged cells in excel exports from Reporting Services reports? I have so I did some hunting around and found some information that looks like its solved my problem.

Add this post and the information at the following MSDN blog and you should have your problems with merged cells in excel exports from Reporting Services reports nailed.


Ed Spencer's Blog

Lets be completely direct here. Cell merging in Sql Server Reporting services after exporting to Excel, is a common nightmare.

It happens because the engine that transforms the report tries to do so on a presentation basis.

I have been developing reports in SSRS for a few years now, and here are the best ways around the issue that I have found:

1. Don’t use standalone textboxes for titles, or any non-data elements.
Rather than fiddle with these for hours trying to get them to line up, just insert another row or two as headers above your data driven report element (e.g. table). You can then play with the presentation of the cells to make it look like it isn’t part of the same table. This can be done by colouring certain borders white to give the impression that there is nothing there.

2. Use points and not centimetres when…

View original post 96 more words

Leave a comment

Filed under Business Intelligence, General SharePoint Development, SharePoint 2010, SharePoint 2013

Whitespace in Excel and other issues with exports from Reporting Services

I discovered some interesting behaviour in the Excel export files from Reporting Services today. Some users of the system I’ve been working on have a requirement to periodically export the data in MS Excel format so they can do some additional analysis. They recently began testing the export function on the report in question and have noted theat they are unable to generate a pivot table because there are additional empty rows and columns before at the top and on the left of the table in the spreadsheet.

My assumption was that when you export to Excel the export rendering engine would only attempt to output the tables on the page. Obviously my assumption was invalid and the rendering engine attempts to render into Excel as closely as possible to the web version including any whitespace around the report. The more whitespace the more blank cells, rows and columns will appear in the Excel export. The quick solution to the issue is to simply move the various object on the report so the edges butt up against each other and the sides of the page. Removing the whitespace in this way means the rendering engine wont include additional empty rows or columns in the spreadsheet.

Note also that I’m note using a head or footer for the exportable version of the report. These will also cause issues if the purpose of the export is to apply a pivot table to the data for analysis.

In-line images also cause issues in the exported Excel spreadsheet. I have small icon in cells in the table with actions defined to open sub-reports. The images were embedded in rectangle objects to enable control of positioning and size. The behaviour I saw in the Excel export spreadsheet was that I had merged columns around the images and this again interfered with apply a pivot table to the data. My only solution here was to remove the images from the exportable version of the report.

Finally, the report had two tables on the page. The first was a summary table and the second was a table containing the detail row for every item meeting the users selection parameters. When the user exports to Excel both tables appear on the one spreadsheet and the user is unable to simply create a table or pivot table on either of the data tables. Ideally the user wants each data table on its own spreadsheet. The resolution to this is again simple if you think in terms of what the rendering engine is trying to do i.e. render what it sees on the page into a similar looking spreadsheet. First we want to force the second table to appear on a new page. This is achieved by configuring the tablix for the first table to put a section break after it (see image below). Once this is configured the second table will appear on a separate page and the rendering engine will interpret the section break as needing to put the second table onto a second sheet in the Excel file.


Leave a comment

Filed under Business Intelligence, General SharePoint Development, SharePoint 2010, SharePoint 2013

Filtering datasets using a boolean report parameter to determine IN value set

Have you every come across a reporting requirement where the user of the report needs to be able to choose between two sets of criteria to filter on a value in the main report. I recently had a requirement where the report I was developing listed tasks by default that had a status of Active or On Hold but I needed to be able provide the user with the ability include tasks with a status of  Initiation, Closed or Cancelled.

The standard report parameter configured for multivalue could meet the underlying requirement by setting the default selections to Active and On Hold  and allowing the user to add in the remaining 3 status’ if they required for example:

Status Multivalue Parameter

but for this report the requirement specified that the user should only have to make a yes/no decision regarding whether to include the additional status tasks in the report i.e.

Boolean Status Parameter

I looked closely at the configuration options for Boolean report parameters and tried a few different things try to configure it so that the two possible values it could be set to were the two status value sets but given it is a boolean the only values it can set the parameter to are 1 or 0. A logical restriction but not helpful for meeting my requirement.

I looked at the options for configuring other types of parameters, such as the Multivalue type, to display like a boolean but again  found nothing helpful for meeting my requirement.

I eventually  solved my problem using the Boolean type parameter and expressions within the filter criteria on the main report dataset.
Here is how I set it up…

1. First set up the boolean report parameter:


and configure the default value to False (for my requirement)


2. Now create two report parameters that will provide the two value sets for the filter. Set the Name of each parameter so it is evident which one includes and excludes the values. In my case I used StatusExcludeSet and StatusIncludeSet.  Set the Data Type to Text and check Allow multiple values. I also selected Internal for visibility as we don’t want either of these parameters to appear to the end-user or be available for setting within SharePoint.


To complete the configuration of the parameter select Default Values from the left panel, select Specify Parameters and then add the default values. In my case these are the actual strings Active and On Hold but check in your dataset to verify you don’t need to specify the actual Id values here rather than the display text.


Don’t forget to repeat this step for the second parameter that includes the additional values in the set that were excluded in the one you’ve just created.

3. Next open properties dialog for the primary dataset, select Filters on the left panel, click Add to create an empty filter and select the relevant field, in my case Status, for the Expression e.g.


4. Next we need to configure the value that will be used for filtering. We will be filtering on a set of values so change the filter Operator to In (as shown in the picture above) and then click on the function (ƒx) button to the right of the Value field. For the expression I used the IIF conditional function to test the value of the boolean parameter IncludeExtraStatusParameter and based on its value return either the value set contained in the Internal parameter StatusExcludeSet or StatusIncludeSet e.g.

 =IIF(Parameters!IncludeExtraStatusParameter.Value = CBool("False"), Parameters!StatusIncludeSet.Value, Parameters!StatusExcludeSet.Value)


Leave a comment

Filed under Business Intelligence, General SharePoint Development, SharePoint 2010, SharePoint 2013