Is it possible to show current Login userName on a report?

Pratap Singh shared this question 20 months ago
Answered

Hi,

Is it possible to show current Login userName on a report?

Regards

Pratap

Comments (4)

photo
1

I would imagine that if you have access filters on and can somehow default it to the current user then you can pull in that filter information by using a method called Parameter Replacement. I do not have access to access filters to verify this but take a quick look at the below on how to perform parameter replacement and perhaps go from there.

http://wiki.yellowfin.com.au/display/USER73Plus/Parameter+Replacement

photo
1

I think I have a solution but it all hinges on access filters and since I do not have the ability to use them I cannot guarantee this solution will work. Here is my theory. It shouldn't take long to prove it once you activate access filters.

First, create a simple calculated field with the value of 1.

af6706c0bc0fe8c9e13bf8ab6df02406

Then create a sub query( to your user's or employee table. Wherever you get the username and also set the access filter too. In that subquery(Append-Left Outer Join), create a calculated field with the value of 1. Use the two calculated fields as the join fields.

03da127ac597d14dbf5b50c13d459bc8

Then drop the username field into the filter section and chagne the operand to Equal to(This must be done or it will not populate unless you click on the username).

3158e66782044f7dad73a95f2f0ea4f5

I'm guessing that the access filter will filter out all other users and only point to the current user(hopefully). Since this is an outer join where both calculated values are 1 and 1 there shouldn't be any issues with the data (no duplication, denial of access, etc).

In the filter for the username make it Value List Selection and Cached Values On Demand. This will make sure that the username pops up before the report runs and also forces a value their making sure it's not blank.

88b77c32cc93fc7de1a0d1d355f570d6


Once this is done you can use parameter replacement to drop the username from that filter into the report like so:

2bc784a9e98ba9ffe07561518f95a671

Click on preview and GO

b2e1f91ec3edd59f821e5cbb672cac7f

photo
1

Thanks Larry,

This is a bit more elegant than the solution I would have suggested :)

Pratap,

Please let us know if this does not work for you.

Nathan