We help IT Professionals succeed at work.
Get Started

SSRS Pass UserId!UserId as Parameter to Data Set

Karl_mark
Karl_mark asked
on
701 Views
Last Modified: 2015-11-26
Evening All! The following is on SSRS 2008.
I have a report set up which currently works by pulling the GUID of a User from our HR application and passes this as a parameter to an SSRS Report. It all works well and the report filters correctly.
However, it is obviously better to not pass the GUID as a parameter (even though the chances of a user figuring out someone else's GUID is minimal) and also using this method requires using a new window in the launching app to pull through the value; pulling the UserId in the report would enable me to place the report link on the main dashboard.

I've read around on Google and clearly the solution is to pass UserId!UserId as the parameter to  the Data sets. The data sets are Stored Procedures which will accept the UserId as a parameter. I've added a Parameter to the report called @UserId and set the default value as =UserId!UserId. The parameter in the data set is set as @UserId. I can't see anything wrong there!

At this point it's worth mentioning that the UserId itself is actually the person's employee number; we have custom authentication so there are no issues with domain names etc. getting in the way. I have tested this by running a report without the paramter but having UserId displayed in a text box and it returns the expected value.

The problem is that when I call the report from our web application I see the following error:

Microsoft.ReportingServices.Diagnostics.Utilities.UnknownReportParameterException: An attempt was made to set a report parameter 'UserID' that is not defined in this report.;

I'm not sure why I am seeing this error. The parameter in the stored procedures is called @GlobalID, but surely that can't be the cause can it? (I can't currently change it anyway as the data source is a database snapshot and for some reason the snapshot update job doesn't seem to be working - have to wait until the dba comes in tomorrow). Is there any other reason why I would get this message?
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE