Retrieve a Customized Report to many Users - active-directory

Goal:
Every user, who has a AD account shall retrieve a customized and personal report, that is filtrerad data of their personal name, sent to their email account.
Problem:
Based on my searching you can send same report to many AD users by using data-driven subscription in SSRS report server. Please look at the picture.
My request is to enable to filtrate the dataset, containing the list of data, that user can read their own data only, not the others. The list of user is based on data from AD account.
Is it possible to do it? If yes, how to do it?
Information:
*You are enable to retrieve their e-mail that is based on their AD account.
*Data source is SSAS.
*Using SQL server 2008 R2.
*The database is a data mart.

Create two Datasets:
Dataset 1 Employee Information
Select
Your Fields here for the report
From your Table(s) Where employeeid = #Employeeid
Dataset 2 Filtered information
Select employeeid
From Table – This should be the same table as from the Dataset 1
Create your report based on Dataset 1
Set a filter on the Report: Use Dataset 2 as the available values for the Parameter (#Employeeid) of the report.
This will give you the filtered information that you need in your report.
You can then use this link to set up your data subscription email: Creating a Parameter Subscription
Hope that helps.

Related

PowerApps - Save data entries to empty data table, and save in SQL Server

I have made the following screen in Power Apps:
My goal is simple: I wish the end-user to enter data into these text boxes -> User clicks "OK" button -> Data is saved for the user right below in a relational data table with columns; Name, Amount, and Measure.
Once all data entries are made, a "Save" button should send the complete data table in JSON format as input for a SQL Server stored procedure, which accepts the parameter #json. How is this accomplished?
What I tried: Tried making a gallery, data table, form, etc. But all of these require me to connect to an existing data set. I instead want the user to create the data set, and then have the data sent to a SQL Server database.
Use the built-in SQL Connector
Create the table in the SQL database
Add the SQL Connector to your PowerApp
Authenticate to the connector
Select the table to connect to
Then write your Patch() logic accordingly
You don't need a Stored Procedure
As an alternative, if you realllly want to use a Stored Procedure, connect Power Automate to your PowerApp and run the Stored Procedure from there. This introduces dependencies though. Your call. Example
Beware:
If you don't setup the SQL Server with Active Directory Auth, you will share your permissions, implicitly, with whomever you share the PowerApp with.
Best to use SQL to create a Group, Assign Role(s) to the Group, then assign Users to the Group
Then each user of the PowerApp will have to explicitly authenticate using their perms
See here

How do I access the Sharebuilder UserID in SQL Server Report Builder

I am trying to pull the Sharepoint UserID out so I can use it as a parameter to control what the user of a dashboard can see. I have tried setting up a UserID parameter using the built-in field UserID and used that in a query to get a list of personnel but Report Builder gives me an error that I am trying to use a forward reference. How can I access the UserID in such a way that I can use to pull up the user's information from a SQL Server database? Thank you in advance for your help.
I fixed this problem by moving my UserID parameter to the top of my parameter list. Thanks

Codeigniter - Connecting to multiple database that are on different server

I want to implement a functionality where I want to change the database based on the user selected company.
For example:
When User A visit my site he needs to login, after the login he can search his company, until this point I am connecting the user to my server db; after he search his company and press the done button I have to make a connection to his server and dynamically change my server db to his company server db. (the reason of doing this is my web app is gonna used by multiple companies so companies gonna have different employee records so i have to connect to db of their server to get their employers records).
I am really confused how to achieve this what data I need to store in my db for making connection to different server db?
As far I researched I understood that I need to store the dbname,dbusername,dbPassword.
Do i need to store anything else? Do I need to store the host name too? Can any of you guide me how to achieve this?
Are you creating individual database as per the company name of that employee, or are you using same database for all the employees?
If you are creating individual database for individual users, you store the company name in to your users information table and when ever you are login, you fetch the company name of that user and store it in to session
and while fetching the record you use the stored company name in to the session for connecting to the database as :
suppose you want to fetch the record from companymaster or some other table you can use like as :
$companyName=$this->session->userdata('companyName');//stored company name in to the session
Now, use the table as
$this->db->from("$companyName"."Your Table Name");
Thanks.

Using Security Extension for certain reports only

My team has a service deployed internally, and part of this service is a list of client accounts stored in a sql table. SSRS is hosted on another server and we have integration jobs which [will eventually] pull these client accounts (along with additional info) from our 3 production environments to this SSRS database.
Also on this SSRS database, I’m creating a new table that will be a mapping of domain accounts and client accounts. I need this table so I can filter my report based on which client accounts the logged on user is allowed to see.
Pretty simple so far.
The next requirement of this is that I need to restrict access to the report itself. I understand I could normally use a security group to do this, but that would result in two separate locations to manage permissions for one resource and this is what I want to avoid.
The solution I’m looking into is to create a security extension to validate the logged in user against the database, allowing them access to the folder/report if they exist in the table. Once in, I can then use that same table again to filter their results.
What I’m not sure of is 1) if this is the best solution and 2) can I use a security extension for just MY portion of the site. There are many other users and reports on this site that I don’t deal with and don’t want to conflict with those.
Could you fill the DB table automatically from AD? Then you can use the standard windows security, but still only do the administration in Active Directory.
link text
You could set up an internal report parameter, called something like UserID, and set its default value to be the non-queried expression =User!UserID . (This user ID can be selected from the list of globals in the Edit Expression dialog.)
You could then add a cartesian/cross join to your users table in your query, with a selection condition based on your internal report parameter - eg. ...and UserTable.ID = #UserID . This would ensure that no records were returned if an unauthorised user was running the report.
Note that the User!UserID field will only return the user for interactively-run reports - in scheduled reports, this will be the account for the scheduling service.
Can't you restrict access to the report by using a security group (either in it's own folder or report level permissions). Use windows authentication in your datasource connection and filter you report retrieving your username using the sql function ORIGINAL_LOGIN?

Can I pass a sharepoint security context value to a reporting services report parameter?

I'm considering using reporting services 05 SP2 with share point integration on a new reporting project.
In this project's reports users can only see records they own. I was thinking a simple userId parameter on the report would allow me to filter the report's results to only these "owned" records.
I'm curious: Can I pass the current share point user's ID to the report some how? Can it be done in such a way that its not possible for the user to somehow alter it? How would I do this if possible?
The sharepoint UserID = the one RS will use and detect.
This is defined by UserID global in RS and picked up form the login token.
You can hide the parameter (Report) or just specify it at the dataset level (SQL).
Have you tried getting row level security happening at the database end?
You project then only needs to pass the users credentials through as it does anyway and you can then let SQL server security handle the issue?

Resources