Tag Archives: Report Builder

Connecting to SSAS from Report Builder Query Designer – A Connection Cannot Be Made

Introduction

Recently I was attempting to create a dataset in the SQL Server Reporting Services Report Portal. I created my data source, then launched Report Builder to create my Dataset.

Report Builder connected to my SQL Server Analysis Services Tabular database OK, the Test Connection button worked, but when I tried to go into the query designer I kept getting the error:

A connection cannot be made. Ensure that the server is running.

I knew my server was running, I could connect to it and run queries from SSMS (SQL Server Management Studio). I found some solutions that suggested I change my SQL Server Browser service to log on using the Local System account. Tried it, didn’t work.

I found another solution recommending I add a firewall rule to allow inbound traffic on port 2383, but no love there either.

The Solution

It turned out it was all related to the way I’d formatted my data source connection string in the SSRS Report Portal. I had entered it as:

Data Source = acdev;initial catalog = WWI-SSAS-Tabular

When I used the Test Connection button in the Report Portal, it worked fine. It even let me connect when I launched Report Builder. But when I tried to launch the query designer in Report Builder, it gave me the aforementioned error:

A connection cannot be made. Ensure that the server is running.

I came upon my solution by launching Report Builder, and telling it I wanted a data source embedded in my report. On my first attempt I simply copied what you saw above from the Report Builder, and was faced with the same crushing disappointing result.

On the second try I used the Report Builder feature to actually build my connection string. Report Builder produced:

Data Source=acdev;Initial Catalog=WWI-SSAS-Tabular

And by golly, it worked! I was able to use the query builder to create a DAX query.

To be sure I was still sane, I went back to the Report Builder and replaced my connection string with the one above. Still in the Report Portal, I added a new Dataset which launched Report Builder.

I picked the Data Source I’d just updated in the Report Portal, and this time I was able to get into query builder, create a new query, and save it back to the server as a dataset.

Conclusion

I can only guess it was the extra spaces around the equal signs that were messing things up. I’d added the spaces thinking it made it a bit more readable. Readable, but as it turns out non-functional.

Some of you maybe going “you big dummy” at this point, and perhaps justifiably. I still think it’s odd though that the test connection buttons in multiple tools all worked, yet the query designer crashed.

Regardless, I’m happy I was finally able to find the solution. I’d spent almost five hours on this, so hopefully this will save you a little time and get you back to creating queries.