Filter SSRS report to current user

gruff

This seems to be a common issue, but I could find no solution which worked.

I have an SSRS report which shows employee Vacation balances.

I want to make a linked report which will only display information for the current user.

The built in field User!UserID, returns the Login of the User, however that Login is generally not used in our DW, so I cannot filter off of it alone. We have a stored procedure which will convert that login to the matching UserID, which I can then filter the report on.

My issue there is that although I have a secondary dataset which returns the current users EmployeeID, that dataset cannot be used in the filter of my primary data set, nor in any parameters.

Because of the need to identify current user, I do not know of a way to do this within SSMS, but am stuck trying to make it work in SSRS

To clarify the linked report idea, I was planning to have a Boolean where true/false indicated whether to display data for the current user or just return all. The linked report was an effort to not replicate the RDL with this minor change

Any help will be greatly appreciated, this is the sort of issue I am sure I will come across again in the future

gruff

I ended up solving this thanks to the mental jumpstart if got from TPhe..

What was needed:

In my TSQL Procedure I created two new variables. One, a Boolean which toggles whether to filter on the person or not. This Boolean is flipped between the SuperUser and Individual report versions. And the second was an EmpID filter (previously we only had a free-text name filter)

If the Boolean is set to view only individual then the report filters to only Current user, which I acquire through a dataset generated by the SP which I mention in the original question.

The key is the Boolean parameter. I titled it viewALL; Defaulted to True for superusers. I then created the linked report, and altered parameters so that viewAll was set to False, meaning show only the current user information.

I had to add these parameters to the SSRS so that I could Manage the report on the ReportServer and flip the Boolean, and of course they were needed in the SQL for use in my where:

Where ((viewALL = 'False' AND EmployeeID = @CurrentEmployeeID) OR (viewALL = 'True' AND EmployeeName like '%+@EmployeeName+%'))

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Filter SSRS report to current user

From Dev

How can I run an SSRS report as the current Windows User?

From Dev

How can I run an SSRS report as the current Windows User?

From Dev

Add a filter parameter to ssrs report

From Dev

SSRS - filter on expression in report table

From Dev

Allowing user to customise data on an SSRS report

From Dev

Generate single report for multiple user using SSRS

From Dev

django filter by current user to vote

From Dev

Filter EntityType by owner/current user

From Dev

Ember filter store by current user

From Dev

Get previous,current and Next Record in ssrs report in a page

From Dev

How to get Current Month's Starting and End dates in SSRS report

From Dev

Filter report by date to show users registered this week through email in SSRS

From Dev

Filter a Report based on user input Microsoft Access

From Dev

Get Current User in django-filter Method

From Dev

Automatic filter for current month and year in Cognos Report Studio ver 10

From Dev

Automatic filter for current month and year in Cognos Report Studio ver 10

From Dev

How to get current login user name in qweb report odoo

From Dev

How to display the current user name in a parameter field using crystal report?

From Dev

Laravel/Eloquent - Querying report cards according to current user

From Dev

Report Parameter validation in ssrs report

From Dev

Passing parameters to a report in SSRS but no report

From Dev

SSRS report - panels are multiplying in a report

From Dev

SSRS Error - "Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate

From Dev

Delete SSRS Report

From Dev

String Split in SSRS Report

From Dev

Crystal Report to SSRS

From Java

SSRS Report Numerical Formatting

From Dev

SSRS Conditional Border Report

Related Related

  1. 1

    Filter SSRS report to current user

  2. 2

    How can I run an SSRS report as the current Windows User?

  3. 3

    How can I run an SSRS report as the current Windows User?

  4. 4

    Add a filter parameter to ssrs report

  5. 5

    SSRS - filter on expression in report table

  6. 6

    Allowing user to customise data on an SSRS report

  7. 7

    Generate single report for multiple user using SSRS

  8. 8

    django filter by current user to vote

  9. 9

    Filter EntityType by owner/current user

  10. 10

    Ember filter store by current user

  11. 11

    Get previous,current and Next Record in ssrs report in a page

  12. 12

    How to get Current Month's Starting and End dates in SSRS report

  13. 13

    Filter report by date to show users registered this week through email in SSRS

  14. 14

    Filter a Report based on user input Microsoft Access

  15. 15

    Get Current User in django-filter Method

  16. 16

    Automatic filter for current month and year in Cognos Report Studio ver 10

  17. 17

    Automatic filter for current month and year in Cognos Report Studio ver 10

  18. 18

    How to get current login user name in qweb report odoo

  19. 19

    How to display the current user name in a parameter field using crystal report?

  20. 20

    Laravel/Eloquent - Querying report cards according to current user

  21. 21

    Report Parameter validation in ssrs report

  22. 22

    Passing parameters to a report in SSRS but no report

  23. 23

    SSRS report - panels are multiplying in a report

  24. 24

    SSRS Error - "Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate

  25. 25

    Delete SSRS Report

  26. 26

    String Split in SSRS Report

  27. 27

    Crystal Report to SSRS

  28. 28

    SSRS Report Numerical Formatting

  29. 29

    SSRS Conditional Border Report

HotTag

Archive