Different reports with similar SQL - reporting-services

I am writing departmental reports for my company in SSRS. Each department will have access only to the report for their department. The thing is that the SQL will be pretty much the same for each report, with department being the only variable. I'm thinking that maybe each report would link to a sub-report that would be common to them all. Is there a better way to do this?

I'm not sure how you are planning to display or send out this report. But you can use the department as a parameter in the SQL query. That way you only need to use one report. This can be passed in various different ways depending on how you are making this report available. Example, the user's profile would have an associated department.
Using one report will help tremendously down the line when you are maintaining it or troubleshooting issues.

Here's what I wound up doing:
I set up a shared dataset that did the heavy lifting with a parameter that specified the department. Each report then used that dataset, passing it the department ID as the parameter to said dataset. Works like a champ.

Related

How to Setup Default SSRS Report Variables

I have many reports which use a set of the same report variables:
Is there any possibility not to insert them each time manually when creating a new report? Or may be there is a possibility to share these variables between reports as , for instance, DataSources?
Can be used for this purpose assemblies?
Based on your question it's seems you're looking for a subreport. Sub Report is a tool available in the toolbox in SSRS. It allows you to create a report that can in included in all your other reports without have to rebuild the structure.
Once you've created your report in the sub report properties just specify the report and include the parameters used for the report (if any) see below:
If that's not what you looking for, then maybe it's shared data sets you're looking for.
Let me know if it's something completely different and I may be able to provide alternative solutions.
Thanks
Gav

Is it possible to loop through datasets in SSRS report and save each dataset as an excel spreadsheet?

I am new to SSRS and I just want to know if it is possible to loop through datasets in an SSRS report and save each dataset separately as an Excel spreadsheet.
For example, if we have a report with 5 managers, if you click on each one of these managers you can see/drill down to all the supervisors that are under this manager and if you click on any of those supervisors you can see all the employees that are under that particular supervisor. Now, what I'm trying to do is I want to save each one of the managers' (and supervisors' eventually) downline in an excel document (although it really can be in any format as long as they can later drill down on it) so that each manager can only get his/her own supervisors/employees. Can this be done in SSRS and if so I'll try to figure out how. Also, if you think there is a better way to restrict every manager from seeing every other manager's supervisors employees please let me know. The report that I currently have is perfect but everyone can see other people's supervisors/employees and their data.
Thanks!!
if you want to generate flat files to send out, then you have to create a parameter on your report, deploy it to the report server, and then create 5 subscriptions to that report.
in each subscription you can set the parameter and where you want to write/email the file.
If the subscriptions part doesn't work well for you (if you have too many to manage), you can use data driven subscriptions (enterprise edition feature), rs.exe scripts (if you figure out how it works), or use my new cool tool (http://busysreports.codeplex.com)
also, you don't have to generate flat files, you can also set up some security so when the managers open the report in reporting services they see only their data.

Run reports/send emails from a list of parameters?

I've run into a problem that, although I feel in my gut there is a 'simple' resolution, I'm not getting anywhere with it! The reports I'm running are using a dataset that includes a username that I need to use to 1) Use as a parameter for running the report and 2) Use to create an email address and send it to the user. I really don't know enough yet about SSRS, or have the experience, to have already created the parameterized report (nevermind the iterating through the dataset that I'm assuming will be needed), nor have I ever set up a data-driven subscription. ANY help on either of these issues would earn eternal gratitude.
Thank you all....again!
Patrick
Its not too bad once you've been through it once. First you need to get the SQL out of your parameter dataset (it's redundant in the report definition). Then in Report Manager/SharePoint you can define the Data Driven Subscription. Paste in the SQL from your parameter dataset into the wizard as the Query, and then use the columns from that SELECT on the later pages of the wizard as required e.g. email address for ... email address.
No coding is required (beyond the parameter dataset which you already have) and the wizard is fairly self-explanatory and well documented.
Good luck!
Mike

Should I use SQL Reporting Services 2008 for my reporting engine?

I would like to use SQL Reporting Services 2008 to generate my reports, but I want to use my own UI for specifying the report type, columns, parameters and everything. I want to be able to take these criteria, and then kick off an asynchronous request to SSRS and have the report emailed to me. Is this possible? I don't want to go all the way down the road of researching SQL Reporting Services 2008 only to find that it doesn't do what I need it to do. Also, I will have a ton of DB partitions that the data will need to be pulled from. Some reports will need to pull data from only one of these, but other ones may actually need to span different databases. Is it possible when sending a report request to SSRS to specify what servername/database to pull the data from? Is it possible to tell it to take the data from multiple databases and combine it? Thanks.
Like Crystal Reports, ActiveReports and other report generators, SSRS has two basic elements behind each report: the SQL query and the report layout. No matter what tool you use for the SQL -- it can be inline SQL in the report or a call to a stored procedure -- it's going to be the same query. Multiple databases are fine as long as you can specify them up front.
You can have parameterized queries, so the user is prompted to input the relevant filters (customer ID, product group, date range, whatever).
Doing the report layout is similar to other tools -- you drag and drop controls like labels onto the report, and set their formatting.
SSRS does provide a lot of options for distributing the report, including email. You can embed the report in an ASP.Net web page, leave it on the report server site for users to browse to, run it in the wee hours of the morning and cache it so every user doesn't have to wait for the lengthy query to run.
It's a great tool. I think it will be worth your effort to experiment with it. I would wait on creating the customized UI until you've exhausted the possibilities inherent in the tool.
SSRS is not designed with this scenario in mind, for that matter I am not sure that any out of the box reporting solution is going to have an elegant solution for this. While SSRS can do what you are asking (as well as others), it is by no means quick or easy. You seem to be looking for an advanced ad-hoc solution with dynamic sourcing of the data. I would first question the requirements and determine if the business scenario really justifies such an implementation. I would weigh custom building a solution vs your learning curve with a BI reporting solution. You may find that it is easier to just build something on your own.
I think the heterogeneous dynamic database mashup is probably going to be the most challenging part.
Depending on what your scalability requirements are, one place that has that part covered, and a report writer, is Access. (Duck! Incoming!)
I think you may be creating a rod for your own back to a certain extent as RS ships with a few interfaces for report creation.
Mind you the end product is an rdl file which is nothing but xml, so you can write them by hand if you really like.
Multiple data sources are supported, but combining them on a single control/chart/etc are not, so you'll need to configure yourself a cross database capability from one of your data-sources prior to the report request if you want to do that.

I can share a SQL Server Reporting Services Data SOURCE... what about a Data SET?

I am developing a Reporting Services solution for a DOD website. Frequently I'll have a report and want to have as a parameter the Service (in addition to other similar mundane, but repetitive parameters like Fiscal Year, Data Effective Date, etc). Basically everything I've seen of SSRS 2005 says it can't be done... but I personally refuse to believe that MS would be so stupid/naive/short-sited to leave something like sharing datasets out of reporting entirely.
Is there a clunky (or not so clunky way) to share datasets and still keep the reporting server happy? Will SSRS2008 do this?
EDIT:
I guess I worded that unclearly. I have a stack of reports. Since I'm in a DoD environment, one common parameter for these reports is Service (army, navy, etc. for those non US users). Since "Business rules" cause me to not be able to use stored procedures; is there a way I can make 1 dataset and link to it from the various reports? Will Reporting 2008 support something like this? I'm getting sick of re-typing the same query in a bunch of reports.
I am not clear if you need to share a dataset, since you have some SQL results that you need to use twice, and don't want to re-compute the same data twice, or you want to do something regarding parameters. So with this "I didn't really understand the question" preface...
You cannot share a dataset. Meaning, you can't, lets say, have a dataset returning table A, and in dataset B try to join with A.
If this is really what you want to do, you could use temporary tables to store A and then in dataset B use the temporary table. There are best practices around that, but since I am not sure this is what you need, I won't spend time talking about that right now.
If you cannot use Stored Procedures, I hope you can use a view.
Else you could leave SQL Server and use CSV sheets as data storage.