简体   繁体   中英

SQL Server Reporting Services Master/Detail Report

I have a report which has a tablix as the master report with a sub report which relies on two fields from the master report. When the master report is opened, the sub report is displayed correctly. However, the sub report is not updated when I click on the next row in the master report; I would expect it to be refreshed based on the values of the two parameter fields.

I think you are misunderstanding how subreports work and what they are intended for.

As stated in the MSDN documentation :

A subreport is a report item that displays another report inside the body of a main report. Conceptually, a subreport in a report is similar to a frame in a Web page. It is used to embed a report within a report.

Typically we use subreport(s) when creating a main report that acts as a container for one or more related reports. This is not the same as Master/Detail in the way that you are understanding it. For what you require to work, SSRS would have to be capable of refreshing the subreport independently within the body of the main report. And it simply cannot do that.

What are your options?

  1. Create a drillthrough report by defining an Action on a textbox or placeholder so that when the clicks on it they are taken to a new report showing the detail. Clicking the back button in the report toolbar returns them to the main report.
  2. Merge your queries to create a single report. You can then use grouping and toggle items, creating a drilldown report, allowing your users to interactively hide/show detail rows as desired.

Of the two, I would recommend the second approach. In my experience users too easily confuse the SSRS toolbar back button with the browser back button.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM