Say we have a Project Status Report in SQL Server Reporting Services (SSRS 2012) that takes the Project ID as the parameter, how can we secure the report so that only team members of that project can see the result?
We have the team members for every project in a separate table.
Thanks.
You can pass the userID as a parameter to your SQL query using query parameters and assigning user id by using command User!UserID. Then inside your SQL query you can check the privileges by using your team member table and return data accordingly
Related
I'm trying to test setting up a data driven subscription that takes a parameter from the report but it wont validate the query, should I be able to do this.
SP: Select * from Table where Column = #Variable
The #Variable is called the same of the report.
This is 2017 version of reporting services
The subscription query does not allow parameters because it is meant to run on a schedule without interaction from a user.
I have a static Pentaho Report(.prpt) on my pentaho server.I am trying to find the way to pass paramater to my pentaho report and refresh(update) the report using pentaho scheduler.I am able to run the sql query each time the scheduler runs.
But I want to pass parameter(user data to be used in mysql query) dynamically so that I am able to generate user specific reports for all users using same prpt file on my server.
How can that be achieved? Can anyone explain with an example regarding the dynamic query scripting in Pentaho Report Designer as there is no material which can be found for the same.
I am using Pentaho Report Designer and Server(8.1).
You must first create a parameter on the report (under the Data Tab, choose Parameters and right-click to create a new parameter). Those parameters can be passed from the URL, or set via a selector/dropdown.
Then you can use the parameter by entering it into the query with a syntax such as shown below:
select * from sales where customer = '$(customerParam)'
I am running SQL 2012 and I have a SSAS multidimensional cube that holds measures for our retail business. I have created an SSRS report that pulls the data from the SSAS cube. I want the user to be able to run the report and only pass the users specific store revenue, customer count, ect, on the SSRS report that they are viewing.
I have created a parameter from the cube. Under the report parameter that was created from the cube I put in under default values, specific values, this expression for the value ="[DimUserTable].[Username].[UserID].&[" + User!UserID + "]", the report will not run. It gives the error;
For more information about this error navigate to the report server on the local server machine, or enable remote errors
Query execution failed for dataset 'Revenue'. (rsErrorExecutingCommand)
Does anyone have any idea how I can accomplish getting only the users store information to show on the report they are viewing?
You only need to pass the user id to the parameter.. your query should take care of the filtering using the parameter. Something like
where [DimUserTable].[Username] = #userid
I would use the following as the default value for the userid parameter
=User!UserID.Substring(User!UserID.LastIndexOf("\")+1)
Of course, this depends on what your cube holds for userid value. If it does NOT include the domain or machine name.. use the above.. else just use =user!userid
I'm having a report (.rdl) in Visual Studio 2012. I know that this report is sent by email every day at 5AM, but I can't find the job that is doing this. I've been looking in SQL Server Agent jobs but it's not there.
I've heard the job can't be in SQL Server agent because then the pictures in the report can't be attached to the email (don't know if that's true?).
I have tried looking in Reporting Services Configuration Manager by connecting to the db, but I think it's only the service/server(?) properties there. Couldn't find any email job sending that report.
When I look at the dataset that is used for the report I can only find the source that fills it (a stored procedure), but that doesn't help me much..
Do you know where else to look to find this job? What is normal when trying to send a .rdl report email? Is it possible to do this from VS 2012?
Report Subscriptions are run through SQL Server Agent.
You can get the job names, which are GUID type strings, with a query like this against your ReportServer database:
select JobName = rs.ScheduleID
, ReportName = c.Name
from ReportSchedule rs
inner join [Catalog] c on rs.ReportID = c.ItemID
Which will give a result like:
This matched jobs that can be seen in the SQL Server Agent:
You can check the job and see what it's doing:
i.e. calling a stored procedure on the ReportServer database.
See SSRS Subscriptions and their SQL Server Agent job names for a more detailed query.
I'm using ReportBuilder 3.0 for creating report in reporting services 2008. I have many DB with the same tables (different data) and I created a report that can be applied to all these DB. I want to add a parameter to choose the database so the user can choose the DB from which getting the data.
I created a parameter (named "DB") with the name of the DBs as avilable values, but I can't use the parameter in the queries as I was expected:
SELECT *
FROM #DB.[dbo].[TableName]
That query (used in a dataset) doesn't work.
There's a way to set the DB as a parameter?
In TSQL, you would use dynamic sql to do this (EXEC(#CMD)). I doubt report builder will allow you to do this. There are security risks to this.