SSRS 2008 R2 Drill Down On-Demand to Sub Report - reporting-services

In SSRS 2008 R2, I was under the impression that a drill down to a sub-report would query the data on-demand.
This isn't the case when my report gets rendered.
Specifically, I have a Tablix that initially loads rows grouped by Person.
When someone clicks the drilldown icon on that Person, a subreport displays some more data pertinent to that Person.
The problem here is that every subreport is being loaded initially when the main report is being rendered. This takes forever to load. But if I remove the subreport, just for testing purposes, the report loads almost instantly.
I've tried setting the visibility of the subreport to Hide initially, then Show when the user drills down, but it didn't change anything.
I read a similar question on stackoverflow, but the answer was to use Drill-Throughs instead.
This unfortunately isn't an option in my case.
Any suggestions?

The only way to defer the data loading is to actually use a new report with and access it via Drill-Through method. This is the way to product work, and is the way inteded by Microsoft.
You can either optimize your stored procedure, limit the number of results per page or use drill-through.

Related

Sub-Report giving error: Report cannot be shown

I have a SSRS Report with six sub-reports. The sub-reports are using the same shared data source which the main report is using.
When I deploy the report and execute, the sub-report place holder shows error: Report cannot be shown.
I thought it could be due to shared data source. Therefore, I created separate shared data source for each sub-report. This works. The report starts showing all the results.
Please let me know what is this issue. Even though it works, I don't want to create separate shared data source for each sub report.
This is a known defect in SSRS 2008. I'm not sure if it has been patched yet, but it has been fixed in SSRS 2012.
As you have found, the workaround is to use separate datasets.
https://connect.microsoft.com/SQLServer/feedback/details/648560/subreport-with-shared-dataset-throws-error

Reporting Services calling subreports

I have a main report and 30 subreports under that report. I don't want to see all of the subs every time I call the main report, I only want to see the subreports that were selected in the application.
How do I only show selected subreports?
The comment from Martin K. is correct if you're only concerned about the display of the sub-reports. You can set the visibility property via an expression meaning it can also be controlled by the result set or a parameter.
However, the real issue is that even though the sub-reports are hidden they are still run. This is because SSRS retrieves all of the data for the report before it finalizes the rendering. There are a number of good options discussed in this TechNet posting. But basically it boils down to two options:
Parameters & WHERE clause filtering
You can set a hidden parameter on the sub-reports and modify the WHERE clause so that the SQL will not actually return any rows when the parameter isn't set to true. This won't stop the report rendering actions but it will stop the SQL commands from having much of an effect on the server.
Just setup a parameter on your sub-report named #ShowSubreport and use filtering similar to the following
WHERE #ShowSubReport=1
Report Definition Customization Extensions (RDCE)
I haven't actually used these but it sounds quite handy, but it isn't exactly simple or easy. Report definition customization extensions allow you to programatically alter a report definition file on the fly. It takes an RDL as input and outputs an altered RDL stream. You can read more about it in the MSDN article : What's New in Report Server Programmability

Subreport is not refreshing in main report, though it is set to autorefresh

I have used a Guage as a clock. It is set to auto-refresh for every 3 sec.
It is running properly, but whole report is refreshing, reloading. So cant get a feel of a clock.
So I tried to use this (Clock) report as a sub-report in another report (say main report) which is not set to auto-refresh.
I am not getting why my sub-report is not auto-refreshed in main report.
Ideas & Hints are welcome!
I've never used the auto-refresh property of a report but I would guess that since it is a report-level property what you're expecting to happen won't work. In order for only the subreport part of the report to refresh it would effectively need to be a frame or iframe (using HTML as a reference). SSRS does not render this way and so your subreport isn't going to autorefresh. It renders the subreport and shows it in the subreport control and moves on.
I'm not really sure how you could have a dynamically updating element in a report using the standard controls. It would need javascript or some kind of other client-side scripting language that gets processed in order to keep functioning and even then it would only work when rendered to HTML.
Basically I don't think this is possible without a third party add-on, and I don't know of one that allows dynamic refreshing of individual report elements without refreshing the whole report.
If you can program in .NET you could write your own custom control for SSRS. This is effectively a third party addon you would create yourself. You could create a clock control and even give it properties to make it customizable. If you're going to use it in reports that you deploy to a report server you'll need enough access to that server to deploy the control assembly to the necessary location. See these MSDN pages for more info:
Creating a Custom Report Item
Jazz Up Your Data Using Custom Report Items In SQL Server Reporting Services

How to refresh subreport on Reporting Services

Is there any way to refresh a subreport in Reporting Services?
When I change something on a subreport file and back to the main report, I have to delete the subreport object and include a new instance again to get my preview updated.
Is there any way to update the sub report object in the main report without having to delete and include the same again?
Actually I think the answer is to ensure that you preview or rebuild the sub-report before you view it in the parent report.
The simplest way to rebuild a subreport is to preview it in BIDS, but you can also right-click | build on the report in the Solution Explorer. Alternatively, rebuild your whole report project if that's easier than rebuilding individual reports.
In BIDS, in your top level report, you should have a Subreport object. That object is essentially just a pointer to another rdl in the project. This should update automatically. What i think you're seeing is BIDS loading a stale version of the subreport. If this happens try closing BIDS all the way down and open the project back up again and rerun the parent report. It should have the updated subreport.
This is all assuming that you've got a report project in bids with standalone reports instead of embedding reports in aspx pages.
I realize this is an old post, but as can happen, I was someone with the issue as well and landed here through searching google. I'm not sure if the OP is using Visual Studio 2008 like one of the commenters is, as am I, but what I found is that while preview on the main report is not showing an updated sub-report, I can see the update by right clicking on the main report in the solution explorer and selecting "run". It doesn't seem to take much longer if at all to open the separate run window.

Dynamically loading SubReport data in SSRS

This is in SSRS 2008.
I've created a report with a tablix, embedded in the tablix there is a subreport. This subreport contains a lot of information (and I mean a lot – it takes more than 45 sec to load it).
I don’t want to show it, or to be more precise – to process/load the data when the report initially runs. Note that I dont want to just not display it - because then all the data is still processed at initial load time.
Instead, I only want the subreport to be processed (and the data pulled down), individually, when I display it (e.g. clicking a + sign to toggle it, or any other option such as clicking an image/ link, while staying in the same report). I also don’t want to open the subreport in a different tab or something like that....
Does anyone know a solution? Maybe there is an onLoad method, dynamic subreport or something like that?
I tried looking into the DataElementOutput attribute, but that's readOnly... anything else?
Before you jump through a lot of hoops to implement a workaround, have you analyzed the execution plan for the query which is delivers the data for the subreport? If you haven't, it's worth it to see if performance can be improved by adding a covering index which will help the query optimizer to deliver the data quickly.
Hope this helps,
Bill
So, as it turns out, the problem was in fact because I had the subreport repeated for each row in the parent report. Thus, the subreport was called numerous times...
And according to MS, there is no way to dynamically process individual subreports. Had to solve this issue by splitting out the subreport (at least the data-heavy parts) to a seperate page. :(