EDUCBA Logo

EDUCBA

MENUMENU
  • Explore
    • EDUCBA Pro
    • PRO Bundles
    • Featured Skills
    • New & Trending
    • Fresh Entries
    • Finance
    • Data Science
    • Programming and Dev
    • Excel
    • Marketing
    • HR
    • PDP
    • VFX and Design
    • Project Management
    • Exam Prep
    • All Courses
  • Blog
  • Enterprise
  • Free Courses
  • Log in
  • Sign Up
Home Software Development Software Development Tutorials SSRS Tutorial SSRS Subreport
 

SSRS Subreport

Updated April 3, 2023

SSRS Subreport

 

 

Introduction to SSRS Subreport

The following article provides an outline for SSRS Subreport. SSRS reports enable users to include one or more linked reports in the Data area. Its purpose is to display another report within the current one, providing extra report customization options. A subreport in the report included inside another report, for example, would be two reports, one Master and the other Child, with the Master invoking the Child report based on specified criteria. The master report’s parameters can be passed to the child report or subreport, which will complete its function.

Watch our Demo Courses and Videos

Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.

What is SSRS Subreport?

Because the subreports are another report, anyone can configure them however we like; be cautious of any rendering or performance limitations. Let’s imagine we’ve created several reports, but we would like to use one of them in a new report (Main Report). Hence, in SSRS, one can use the Sub Report Item to call whatever report. Following the development and testing of an SSRS report on the server, the report is deployed to the running server, where the user can view it. Users can access SSRS reports from anywhere if deployed in a web environment.

Subreports have the following benefits:

  • First, permit us to combine multiple linked reports into a single report.
  • For example, we can nest or insert one report inside another using SSRS sub-reports.
  • Allows us to send parameters (Parameter values) from the main report to the SSRS sub-report.
  • If the SSRS sub-report is nested within a table or lattice, the sub-report will be re-created for each column. Otherwise, it will only appear once.

A subreport in a report is functionally analogous to a frame on a Web page. It’s being used to put a report inside another report. A subreport can be created from any document. The subreport report is normally kept in the same directory as the parent report on a report server. The parent report can be expected to transmit parameters to the subreport. A subreport can be reused within data areas, with every occurrence of the subreport employing a parameter to filter data.

How to Create an SSRS Subreport?

A subreport item can show numerous data sets in a data region or manage multiple reports in one report. As a result, we can quickly create many small reports and integrate them into a major report. Whether the report server is in local mode or SharePoint essential material affects the syntax used to specify the subreport. To review a subreport in the main report in Report Builder, either report must be on the same report server or specify the subreport’s entire path.

If the findings are to be delivered to a SharePoint Integrated SSRS server, the primary and subreports must be from the same folder, and the report’s name should include the file extension. The page splits specified inside the subreport would be ignored if contained within a table or matrix cell. A subreport could be placed in an empty place in the reporting body of the parent report, and it can be placed in a data zone. When we embed a subreport in a data area, this will repeat for every grouping or detailed row.

Subreports, for example, can be used to create side-by-side reports, master-details reports, presentation books, and so on.

Creating a report in SQL Server Data: This will then launch a VS 2012 and Opt a Report Server Project.

SSRS Subreport 1

Adding a Data Source:

Select a New Data Source By right click on the folder Shared Data. And by then, select the Connection String.

SSRS Subreport 2

Adding a DataSet:

Select the Query button to choose a new Dataset.

SSRS Subreport 3

Next, in the Query Designer, add the respective details of a customer.

SSRS Subreport 4

Imposing the Main Report:

Select a Report from the wizard and do the following steps:

Select a Report from the wizard

Drag and drop the list item from the Toolbox onto the main report.

SSRS Subreport 6

Similarly, do for other fields to add an item.

SSRS Subreport 7

Now comes the main part of the subject to add SSRS Sub-report.

SSRS Subreport 8

The next step is to add the parameters by choosing an Add Parameter Option.

Add Parameter Option

The Properties window for the Sub-report appears. From the report server, navigate to and pick the report name (Report1) we wish to use as a sub-report. To check the sales analysis, click preview and input a CustomerID in the parameter box.

SSRS Subreport 10

Example of SSRS Subreport

Two subreport components will be displayed in the report, and employee information will be displayed in the child report. Finally, I’ll link the child report to the main report’s subreport items.

We’ll have two reports to go over. The procedures would be the same for both reports; however, we will run the query below in the case of the master report.

Code:

SELECT
[PatientID],[PatientName],[BelongsTo]FROM [SSRSExperiment].[dbo].[tbl_Patients]

So for the subreport, we’ll run the query below.

Code:

SELECT
[PlayerName] ,[Matchdone] ,[RunsScore] ,[Wickets] ,[Fee]
FROM [SSRSExperiment].[dbo].[tbl_Players]
WHERE [BelongsTo]= @CountryName

It’s worth noting that we’re using the @CountryName argument. As a result, the subreport will be prepared at execution depending on the parameters supplied. As seen below, we will also have two documents in our project once the reports are completed.

SSRS Subreport 11

As illustrated below, click the Test Connect button to see if the report’s connection is functional or not.

click the Test Connect button

Next, while executing Sub-report alone, we yield the below snippet.

SSRS Subreport 13

Imposing a subreport in the master report.

master report

The next step is to choose a Subreport property and enter the necessary parameters.

enter the necessary parameters

Upon pressing the Add button on the Parameters tab, give the option the name “CountryName” and the value “=First(Fields!BelongsTo.Value, “DataSet1″).” When you’re finished, click the OK button.

Finally, a Sub-report has been generated like this:

SSRS Subreport 16

The tutorial component of the Sub-report deployment into the main report is now finished.

Conclusion

The article describes the process for creating sub-reports in the report designer and builder. It also depicts the SSRS report deployment process. And also, we have touched upon their creation and advantages in brief.

Recommended Articles

We hope that this EDUCBA information on “SSRS Subreport” was beneficial to you. You can view EDUCBA’s recommended articles for more information.

  1. SSRS Versions
  2. What is SSRS?
  3. SSRS Interview Questions
  4. Python String to Float

Primary Sidebar

Footer

Follow us!
  • EDUCBA FacebookEDUCBA TwitterEDUCBA LinkedINEDUCBA Instagram
  • EDUCBA YoutubeEDUCBA CourseraEDUCBA Udemy
APPS
EDUCBA Android AppEDUCBA iOS App
Blog
  • Blog
  • Free Tutorials
  • About us
  • Contact us
  • Log in
Courses
  • Enterprise Solutions
  • Free Courses
  • Explore Programs
  • All Courses
  • All in One Bundles
  • Sign up
Email
  • [email protected]

ISO 10004:2018 & ISO 9001:2015 Certified

© 2025 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

EDUCBA Login

Forgot Password?

🚀 Limited Time Offer! - 🎁 ENROLL NOW