I have an SSRS report that is sent out to different user groups based on the business function. I need the subscription to change the from address depending on who the report is being sent to. For example when the report is for the Finance group it should be sent from Finance#example.com but when it is for the Procurement group it should come from ProcurementAdmin#example.com.
Presently the report is just sent from the address configured in the from field of the subscription settings.
I read in a post somewhere once that changing the owner ID in the Subscriptions table would do it - but that did not change anything for me.
Is there a way to make the from address dynamic in an SSRS subscription?
I'm using SQL Server and SSRS 2008 R2.
The simplest way to do this is to create multiple subscriptions with different from addresses configured. But if you have the Enterprise or Business Intelligence edition of SQL Server there is a better way.
You can accomplish this using a data driven subscription. This allows you to set all of the subscription options with SQL queries. You will need Enterprise or Business Intelligence edition of SQL Server in order to use data driven subscriptions.
I'm assuming your report takes a parameter to determine the type of report (e.g. finance, procurement, etc.)
First go to the Subscriptions section for your report and create a new data-driven subscription:
You then configure your data source for the SQL query that will return your subscription information. Note: this doesn't actually have to rely on tables in the database you can synthesize all of the values in a SELECT statement if that works for you.
You could use a query similar to this to get all of your settings:
SELECT 'finance' AS type,
'finance_report_people#example.com' AS rcptAddr,
'FinanceAdmin#example.com' AS fromAddr
UNION ALL
SELECT 'procurement',
'procurement_report_people#example.com',
'ProcurementAdmin#example.com'
Then the next couple of screens allow you to use the values determined by this query to set various options for the subscription. In this case you would set your parameter value to the type field, your to value would use the rcptAddr field, and you would set your from field with fromAddr.
In this way you can configure dynamic subscriptions that have different recipients, reply to addresses, from addresses, subjects, etc. all based on the parameter value you're passing to the report.
Related
I have an SSRS report that generates customer invoice for selected customers. I want to be able to generate this report each month for selected customers. What do I do to be able to generate a report for, say, April for ABC Corp.? I have the case 'created on' date.
Look up Reporting Services Subscriptions.
Standard subscriptions allow you to set up the report server to send you a report for ABC Corp every month. You enter the parameters (such as ABC Corp) the way you would enter them to generate the report manually.
Data Driven Subscriptions allow you to automatically distribute reports to people. The parameters can be different for each person, and it doesn't look the same as the manual approach. You may create stored procedures to manage data driven subscriptions, and these are going to be more complex than standard subscriptions.
We have SSRS 2008 and have a heap of data driven subscriptions.
We've been tasked with creating a map of all the reports every user receives.
The query:
SELECT * FROM ReportServer.dbo.ExecutionLog2
gives us almost the information we want.
For what we want, it lacks the destination of the report.
Is there a way of finding out where a report was emailed?
My alternative I guess is to look at analysing the Exchange logs.
Is that a reasonable alternative?
You could get the destination of the data driven subscription from columns Parameters and DataSettings in the table Subscription from report server database.
The 2 columns record as xml format , you could get the node in column Parameters and get the node in column DataSettings. Then you could get correspond receiver for subscription.
I have a database with many customers inside of it. Each row of the table has a customer ID that denotes which customer the data belongs to.
Is it possible to let the end user use Ad-Hoc reporting to build reports, but only let them see data associated to their customer id?
In a report you can use the Built-in field UserID to return the current user's domain name e.g. MYDOMAIN\Username.
If you can create a table mapping customer Ids to domain names and join this to your main data table then you can add a where clause into your dataset query such as
WHERE MappingTable.DomainUsername = #CurrentUser
In the report, create a hidden parameter called CurrentUser and set the value to Globals!UserID.Value
You need to be using Windows authentication in the report data source, where the report users credentials are being passed through to the data source, for this solution to work.
EDIT: I see I misread your original question, which was actually asking if it's possible to allow users to create ad hoc reports while restricting their view of the data. This scenario precludes any solution that is implemented in the reports themselves, since the users will be designing their own reports. Instead, you will probably need to implement some form of security layer in source database, for example using Views. You can use a similar approach to above if your users are using domain logins. For example your view could contain a reference to SUSER_NAME() to limit that data for that particular user.
Given a SQL Server 2008 Reporting Services installation, what's the "cheapest" way to check whether a given report (given by its report name + report path, e.g. /MyReports/SomeOddballReport) exists (or not) ?
I see lots of potential candidates on the ReportServer web service - which one is the quickest and the one using the least amount of system resources??
FindItems()
GetReportDefinition()
GetReportLink()
GetProperties()
Any others I'm missing? Thanks for any hints and pointers! I find the Reporting Services webservice interface to be lacking in documentation and samples, really......
Seems fastest way is to use FindItems method.
All other options seems to be metadata related, as them retrieve properties for that items (so it needs to find item first and, so, get those metadata)
Due to MS Reporting Services running on MS SQL you have an easy option to return report names and to see if a report exists. Inside of SQL Server there is a database called ReportServer. Within that database is a table that is called Catalog. The Catalog table stores data sources, reports, and some other vital information. The key fields are the "Name" and the "Type". Type distinguishes between a report / a datasource / etc. Name of course is obvious, it is the name of the report.
To get all reports on your reporting service instance try this:
USE ReportServer
GO
SELECT Name, Description FROM Catalog WHERE Type=2
To get all data sources:
USE ReportServer
Go
SELECT Name, Description FROM Catalog WHERE Type=5
So if you have a name or at least know of what a report starts with you can do a LIKE query:
SELECT Name FROM Catalog WHERE Name LIKE '%Employee Report%'
Check out my blog for more info:
http://weblogs.sqlteam.com/jhermiz/archive/2007/08/14/60285.aspx
Also since you mentioned it therte is a path field which may contain data like this:
/ETime/Job Hours Summary By Department
I'm designing a SSRS report in Visual Studio for use as a local report (so a SQL Server is not involved).
I have a table with customers/addresses that has the following columns:
AddressID
Firstname
Lastname
Street
Another table keeps orders and looks like this
OrderID
CustomerAddressID
ShopAddressID
So two columns from my order table link to datasets in the address table. I want to display both addresses in my report. The datasource for the report is a xsd dataset.
What's the best way to do this in SSRS? I'm pretty new to SSRS and kind of lost with the dataregions, lists, etc.
You should edit the source for the second dataset to include a parameterized query based on the first one. Something like:
SELECT * FROM other_table
WHERE CustomerAddressID = #adress
OR ShopAddressID = #address
Of course you should create the address parameter as report parameter(pointing to the first dataset)
Hope this makes sense.
Look at subreports.
To be a bit more specific, you need to define multiple data sources in your report that these other regions, tables, or whatever, obtain their data from. You then need callback handlers in your app that can provide that data for each datasource (quoting: "your application must handle the SubreportProcessing event of the LocalReport object.". The article explains this in detail.
Just curious (because I am going to through the same thing right now) - are you really designing SSRS reports (2008), or VS reports (2005)? Because the 2008 ReportViewer control cannot render SSRS 2008 reports ....