Export separate pdfs from SSRS generated report - reporting-services

Is it possible for SSRS to name and separate pdf exported files based on parameter groupings? Right now, when I run the report, it only gives me one pdf with 100+ pages. However, at every page-break, I'd like SSRS to create a new pdf file, and it'd be a real time-saver if it would also insert the pdf's filename based on the grouping selection.
Is this possible in SSRS, or do i need to use SSIS for this functionality?
I'm using 'Visual Studio 2010' for SSRS, and 'SQL Server 2012' for integration services

You would be able to do all of what you want in SSRS - if you have the Enterprise edition that has Data-Driven Subscriptions.
https://msdn.microsoft.com/en-us/library/ms159150(v=sql.130).aspx
You would have a parameter for the grouping (your page-break) - for example UserID.
In your data-driven query (NOT the report but a different query used to fire the subscription), you would have a field for your grouping - your UserID in our example. Another field could have your ReportName that is derived from your data - ex.
UserID, 'ReportName for ' + UserName + ' on ' + GetDate() as ReportName
When the data-driven query runs, it will create a record for each UserID which in turn will fire a report for each UserID using it as the parameter to limit the report to just that userID. You could even have that report only e-mailed to that user.
There are ways to run data-driven subscritptions without the Enterprise Edition using SSIS but the do take a bit of work.
http://geoffbi.blogspot.com/2012/04/data-driven-subcriptions-in-standard.html

Related

'Report Link' for SSRS to Read Directly From Server and Transfer Parameters

I'm currently working with Visual Studio 2012 and SQL Server 2012 and trying to figure out an SSRS-related question boss asked me.
Currently in SQL, in one server I have a Comment Table which features over 2 million records and due to restrictions on main DW, I'm not able to transfer all the data from that server into a different server where all my reporting is done from.
Using SSRS, I'm trying to see if there is a way where I can provide a 'comment lookup' link and have it launch a SSRS report that can read directly from a server and also transfer parameters?
Any help or suggestions would be greatly appreciated.
There's a few ways you can do this.
In the current report
As #LONG said in a comment on your question, if the Sql Server with the comments is a linked server in the data warehouse Sql Server, then you could include the comments within the same report. This is like including data from another database on the same Sql Server, except you also specify the linked server name like so: LinkedServerName.Database.Schema.TableName.
For example, let's say the comments are on blogs:
SELECT B.Title, C.Comment
FROM Blogs B
INNER JOIN CommentServer.CommentsDb.dbo.Comments C ON C.BlogId = B.BlogId
In a drill-down Subreport
You can create a report which uses a datasource that accesses the Sql Server with the comments. On your main report, on the relevant cell for the field, Right-Click, select Textbox Properties... choose Actions in the left menu, select Go To Report and choose your comments report from the drop down. Then you are able to map the subreport's parameters to the main report's parameters and fields and these will be passed through when running the subreport.
When you click on that field when in the main report, it will automatically drill down into the comments report.
As a parameterised link to run the report
Again, create a report for the comments. On your main report, on the relevant cell for the field, Right-Click, select Textbox Properties... choose Actions in the left menu, select Go To URL. For the expression for the URL, put in something like:
="http://ReportServer/ReportFolder/ReportName.rdl&rs%3aCommand=Render&BlogId=" & Fields!BlogId.Value & "&FromDate=" & Parameters!FromDate.Value & "&ToDate=" & Parameters!ToDate.Value
This will turn the field in your report into a parameterised link to the comments report.

Using the report execution web service, how can I tell if a report's table returned no rows?

I have a C# project which consumes the ReportExecution2005.asmx web service. In my project, I loop through some database records, pass the row's data to the report's parameters, then render the report.
The report is a simple, one dataset, one table report, that I end up exporting to Excel.
When I'm rendering the report, I don't know if the parameters I am passing will actually result in the report's dataset/table returning any rows. If the report does return data, then I send my report out in an email. However, if the the report's table is empty, then I need to skip this report and move on the next report.
Is there anyway I can check my rendered report to see if the dataset or table returned any data?
Thanks for looking.
This sounds more like something that could be done in the backend sql than in the report. The report just generates, to my knowledge there is nothing baked in that can do this. The knowledge of a subscription is pretty basic .... but you can do dynamic subscription that can go off of database logic.
I believe you could do a multi tiered approach to make a subscription be dynamic for this.
Create a job in SQL Database for a database that keeps track of reports having data. Just do a simple insert into RecordTable select (reportname), dateadd(day, datediff(day, 0, getdate()), 0), Count(*) from (tabledataset).
Have this job run every day at a set time to populate if your dataset has rows or not.
Create a dynamic subscription to perform a query if the rowcount is greater than zero to send out, if not do not.

Generate SSRS Reports for resolved cases by month for selected cusotmers

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.

Reporting Services report logs report destination

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.

SSRS - How to render child datasets

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 ....