Friday, November 17, 2017

SSRS: The Hidden Expression For the Tablix Has a Scope Parameter That Is Not Valid For an Aggregate Function

A while ago I ran into an issue when creating an SSRS report. It was a bit of a cryptic error message for me at first, as you can see below. After struggling with it for a while I finally found the issue and I thought I could as well share it so you can find it faster than I did. :)


When running my report I encountered this error message. It talks about a Hidden expression of Tablix1, and that the scope parameter used is not valid. After finding the solution the message was kind of clear to me, but the thing is, when running the report at first I was a little lost. - SSRS: The Hidden Expression For the Tablix Has a Scope Parameter That Is Not Valid For an Aggregate Function - Report error


It is very obvious the message is about Tablix1, so I start with looking at aggregate functions I am using in that tablix. Finally, I end up checking the visibility of the tablix and I notice the expression for the display option of the tablix. - SSRS: The Hidden Expression For the Tablix Has a Scope Parameter That Is Not Valid For an Aggregate Function - Display options

This feature is used to show or hide the tablix based on an expression. You can see the expression I used below. - SSRS: The Hidden Expression For the Tablix Has a Scope Parameter That Is Not Valid For an Aggregate Function - Expression Editor

As the Expression dialog states, you have to Set the expression for: Hidden. This actually means the following: if the expression evaluates to true, the tablix will be hidden. So if the expression evaluates to false, the tablix will be shown.
The problem however, is in my scope parameter: “DataSet1”. This scope parameter is optional for an aggregate function that can evaluate the aggregate function over that parameter. It can be a Row or Column group, a data region or (as it is here) a dataset.


The problem is, when I started with the report I entered this expression, but afterwards I altered the name of the dataset. This makes the above Hidden expression for the tablix invalid because Dataset1 doesn’t exist anymore.
So after updating the name of my dataset in the expression for the tablix my report ran just fine again.

If you have any remarks or questions, feel free to contact me on Twitter:

Friday, November 3, 2017

SSMS Status Bar Colors

I want to share this quick post for setting the color of the status bar in Management Studio (SSMS).

This post is also part of the #SQLNewBlogger challenge that Ed Leighton-Dick (@eleightondick | b) started back in April 2015:

TL;DR – In April, I’m challenging myself to write (and publish!) here regularly, and I’m extending an open challenge to other new bloggers to do the same.

You can read about his idea and the origin in his blog post, for my post on SSMS keep on reading here!

In SSMS, you can go to Tools > Options > Text Editor > Editor Tab and Status Bar.


In the Status Bar Layout and Colors part, you can set the default colors for Single server connections (the standard) and Group connections. The colors you set here are for all connections when you don’t explicitly set another color for the current connection

One-time Connection Color

When you want to set a different color for a one-time connection you can do so in the Connect to Server dialog: - SSMS Status Bar Color - ConnectToServer

Click on Options >> and go to the Connection Properties tab. - SSMS Status Bar Color - ConnectionProperties

In the bottom, select User custom color: and click on Select… You can select your own color there
Just keep in mind that setting the property here will keep it until you deselect it the next time. So if you don’t want this color to be applied to all subsequent connections you make, you’ll have to uncheck the box the next time you connect to a database via this connection box.

Registered Server connection

Instead of connecting to a specific database via the Connect to Server dialog, you can “save” a server/connection as a registered server. You can do this via Registered Servers > New Server Registration. On the Connection Properties tab you can also apply a custom color here as you see in the picture below, so you don’t have to undo applying the color when you’re connecting to other servers.


If you like this type of basic posts be sure to check out the #SQLNewBlogger hashtag on twitter.


Friday, October 20, 2017

Suggested Reading for October 20, 2017

I came across some nice articles and blog posts in the past weeks I wanted to share:
  • The purpose of this series is to help others succeed.  The authors have all ridden the elevator of success to the top and received their MVP awards to reflect that fact.  Now it is our responsibility to send that elevator back down so others may benefit from our experience.  As an indication of our intent, all profits from the sale of this book are to be donated to charities.

I hope you can get something useful out of here, feel free to let me know if you find other useful links that I should include next time!