You could display a Subreport in Server report easily; however, you will get error message: Sub report could not be shown if you just follow above article to add a subreport in a local report. This article describes how to add a subreport in a local report.
The sample in this article uses the NorthWind database, the report displays the Customers list and Customer's detailed Order information of every Customer.
•1. Create a web application
•2. Create a Main report using Report Wizard
3． Create a Sub report using report Wizard
•a. Right-click the project name again to select Report Wizard template, and then type in "OrderInfo" for report name.
4． Add a parameter CustomerID for Subreport to filter the Subreport's DataSet
5． Drag a Subreport control into Main report
6. Add a ReportViewer control into your Web Form
7. Add below code to display Subreport in Main report with ReportViewer control
protected void Page_Load(object sender, EventArgs e)
ReportViewer1.LocalReport.SubreportProcessing += new
public void SetSubDataSource(object sender, SubreportProcessingEventArgs e)
8. Add a drill-down feature to the main report
Run the project, you will get the report like picture one, which display all customers' information, drill-down the + sign, you will get all the orders' detail information of every customer, as picture two's layout.
Configuring Subreports and Drillthrough Reports
[Download the sample]