Clarification on Parameters
OK, I'm slightly confused on the behavior of parameters. Well, maybe "confused" is a bit storng; I'm not babbling, walking into walls and drooling uncontrollably. Basically, I guess I'm not totally clear on what it means to have a parameter in the Parameters folder in Report Data set with a default value and to have the parameter value set in the Dataset properties. Clear as mud? I have a parameter in a report that is keyed off the logged in user's ID. I have its default value set to my ID, so that I can work on the report without having to log into the environment that runs the report. I have the Dataset parameter value set to the logged in user's ID. Now, what I'm thinking is, the system will use the default value I set up, if there is no value assigned to a logged in user, but if there is someone logged in, it will use that ID, instead of the default. What that means is the default is set to "MyID" and the Dataset parameter is told to get its value from the Built-in Field, "UserID." But, this fails to work when I test it in the report environment. However, when I change the Dataset parameter to get its value from the Parameters Field, and change the default to get the login ID from the Built-in Field, rather than my ID, it works. So, I figure that the default value for a parameter is not something that is used when there is no other source of data, but is what is used, regardless of whether or not there is another source of data. If I've been clear enough, am I correct on this reasoning?
July 20th, 2012 10:42am

Hi There Thanks for your posting. Can you please elaborate further what is "MyID" and how do you put that value as default value. But, this fails to work when I test it in the report environment, what do you mean by fail here I might have misunderstood your problem completely and I apologise in advance for that. But why would you need to put "MyID" as default because if you put both in available value =User!UserID and in default value =User!UserID What is disadvantage of that? Please let me know if I have misunderstood you problem Many thanks Syed Qazafi anjum
Free Windows Admin Tool Kit Click here and download it now
July 21st, 2012 4:56am

Hi Adam, What I understand is that you have a report parameter named MyID and then you have a dataset parameter. Also, your MyID Report parameter has your login hardcoded as its default value, and then your dataset parameter has its value set as the logged in user's id (I am presuming you are doing this thru User!UserID). What I would suggest is to associate your MyID report parameter with User!UserID and in your dataset properties, map your dataset parameter to the MyID report parameter. Again, I might have misunderstood your question, and as Syed says in his response, if you can mention above the "fails in the report environment", we will be able to help you better. HTH. Cheers, IceQB Please mark correct answers :)
July 21st, 2012 5:43am

Hmm...let's see... The report is supposed to grab the user's ID from the username of the person who's logged in and then use that ID to generate a status report based on it. But, during testing and debugging, I just want to be able to preview the report, so I set the Default value in the Parameters section to "my_username" and the Parameter value in the Dataset is set to User!UserID. My thinking is that, when the report sees that no one is logged in, it will use the default from Parameters. If it sees that someone is logged in, then it will skip the default and use the ID taken from User!UserID. When I put the report into production, I hide the parameter so as to not bring in the drop down, expecting it to skip my default ID and take the logged in user's ID. But, what it does is, no matter who is logged in, it uses my ID. So, I remove the default and it gives me a parameter not found - or, has no value, I think is the actual error. The way this was fixed was to make the default "User!UserID" and the Dataset Parameter value "Parameters!UserID.Value." This way, the report correctly picks up the logged in user's ID, but it is just not what I expected from the use of a default. I expected, if someone is logged in, use login ID; if no one is logged in, use default. But, it just doesn't seem to work that way. Basically, I got it to work properly, but it just seems cattywonkus to how it seems it should work. So, I figured I'd see if I was missing something or if this is just the way it's done. Does this help?
Free Windows Admin Tool Kit Click here and download it now
July 23rd, 2012 11:58am

The only successful fix I've found is what I'm doing; make the default "User!UserID" and the Dataset Parameter value "Parameters!UserID.Value."
July 30th, 2012 12:05pm

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

Other recent topics Other recent topics