I have created a report that users are able to run on demand. I have the data source set to prompt for authentication.
The business also requires that we send this report out as a data driven subscription. With a data driven subscription, all data sources have to have Credentials stored securely in the report server.
Because of the business requirements of allowing users to manually execute the report when they want and to have the report sent out as a data driven subscription, I have 2 versions of the same report and have to update them both when changes are needed.
Is there a way to have 1 report that users can manually execute (being prompted for credentials) and it also be sent out as a data driven subscription?
Related
I have configured a report with 14 Data-Driven Subscriptions that get executed every month. They aren't executed by schedule. They get executed by a tool who knows the SubscriptionIds.
Now I ran into the problem that all subscriptions changed to done except one subscription.
When I query the very subscription on the ReportServer DB in the ExecutionLogStorage, I can see that the Subscription got executed 6 times with the correct parameters.
Even if I manually rerun the subscription, I get 6 produced reports but the status doesn't change.
The subscriptions are data-driven because I query a Database View with dynamic information and based on the output, there are x Reports per Subscription that get sent to a recipient.
Do I have to re-create the subscription or is there a way to fix the Last Status of the subscription?
I have a report that takes a single crm record as a parameter and I would like to configure a data-driven subscription for it such that each time this subscription runs it produces multiple PDF files, one for each record returned in the parameter query. I noticed that when the subscription runs it produces multiple PDFs, but only the first of the parameter results is used. Is there a workaround for this behavior?
Senario 1 :
I am sending different clients same report with different data. For Example Client 1 wants reports for xyz region and Client 2 requires for other region.
I have created subscription for report once and then pick subscription Id and ScheduleId from Report server table to manually trigger
I am retrieving all setups from database for clients defined email address and regions. Looping through cursor I am processing those details and updating Email Address and Report Parameters in the [ReportServer].[dbo].[Susbcriptions]
Then using below SQL send PDF to the clients.
exec ReportServer.dbo.AddEvent #EventType='SharedSchedule', #EventData=#ScheduleID
WaitFor Delay 00:00:45 - To allow report processiong to be finished.
Problem1: When Looping through cursor - sometimes client 2 never gets report.
Senario2:
For Example, I want to send different license details License 1, License 2 and License 3 to the one client.
Using above method sometimes clients gets License 1 details report 2 times and then License2 details report skipped.
Hope this will provide more information. I am using SQL SERver 2008 Reporting services.
What goes on internally for SSRS subscriptions is a bit complicated. (See this answer for more info: https://stackoverflow.com/a/22163743/201021).
An alternative to rolling your own solution would be to use Data Driven Subscriptions which is a feature of SSRS in SQL Server 2005 and up. There is a good MSDN article on how to use them: Create a Data-Driven Subscription (SSRS Tutorial)
If that won't work for you I'd recommend using the web service rather than trying to do this directly in the SSRS database. This will ensure that SSRS still has control over exactly how the subscriptions are run. Plus the structure of the Report Server database isn't guaranteed, while the web service should remain relatively the same. A few good resources:
MSDN Report Server Web Service
MSDN Accessing the (SSRS) SOAP API
Codeproject article: Programmatically Playing With SSRS Subscriptions
What are the difference between subscription and data driven subscription in SSRS?I have read about these two,but i didnt get the exact difference.both are scheduling,so both will be execution at scheduled time or different?
A data driven subscription is dynamic. This is directly from MSDN. With a data driven subscription you can:
Distribute a report to a fluctuating list of subscribers. For example, you can use data-driven subscriptions to distribute a report throughout a large organization where subscribers vary from one month to the next, or use other criteria that determines group membership from an existing set of users.
Filter the report output using report parameter values that are retrieved at run time.
Vary report output formats and delivery options for each report delivery.
Meanwhile... with a standard subscription (again from MSDN) "the report consists of static values that cannot be varied during subscription processing. For each standard subscription, there is exactly one set of report presentation options, delivery options, and report parameters."
I am developing SQL Server Reporting Services (SSRS) reports on SQL Server 2008 R2 and using Report Manager as a method to demonstrate and test reports. I am looking for a way to allow users of the same domain to connect to the Report Manager and run reports via a browser (not SharePoint) without letting the user have too much access to the data source. I currently have each user listed as db_owner for the database that the datasets and data source are associated with. I would like to limit this access and I have tried db_datareader but this level does not allow the user to run the reports and gives the user this error: “Cannot create a connection to data source 'DBname'. (rsErrorOpeningConnection)”.
My method of adding a user to The Report Manager site: I select the ‘Security’ tab under ‘Site Settings’ and then select ‘New Role Assignment’ adding the user as a ‘System User’. I then select ‘Folder Settings’ on the toolbar and again select ‘New Role Assignment’ adding the user as a ‘Browser’. I have tried adding a user as a ‘Content Manager’ but they still have the same error when it comes to the data source.
My method of adding a user to the data source: select new login from the Security tab for the server, add domain\username to ‘Login name:’, use Windows authentication and change the default database from master to the database that is the reports data source. I then select ‘User Mapping’ and put a check next to the database that is the data source. In the ‘Database role membership for: DBname’ section I choose db_owner and public is already selected. I have included screenshots below.
My question is what ‘Database role membership’ can I use for SSRS and Report Manager that would not be as broad as db_owner and would have the best security? I have tried db_datareader but then the user cannot connect to the data source when they run the report.
I have researched this question but I have not found any details accept for adding the user as a db_owner as I described. MSDN acts as if the settings in Report Manager are all that you need to set for the user/report to have access to the data source. I have tried only using the Report Manager settings with both settings for a data source, shared and imbedded with no luck.
Thank you in advance
Typically, the data sources in SSRS will be set to use a fixed account, either a Windows account or SQL authentication. This account should be given minimal privileges to the database: db_datareader is common.
Then security to the report is controlled through Report Manager as you describe above. this avoids the need for changing security on the database itself with changes in user permissions.
But the approach you describe above should work as well. The error you see when the user has db_datareader access is surprising if your query is a standard SQL query selecting from tables. If you are using Stored Procedures, you need to grant access to those as well. Use a test user account that is set to db_datareader; see if you can connect and execute your query through SQL Server Management Studio.
Depending on your security requirements, I would use a dedicated account for database access from the reports, say "ReportReader." Develop and test your reports accessing the databases as this user, and make sure the user has minimal access, read-only and/or limited to only the tables or procedures they need to execute.
The credentials used to access the database are set in the properties of the datasource. This is one reason that Shared datasources are often used, and the reports are linked to the shared datasources:
The screenshot shows a SQL server authenticated account in use. This could just as easily be a fixed Active Directory account; check the "Use as Windows credentials when..." in that case.