EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login
Home Software Development Software Development Tutorials SSRS Tutorial SSRS Subreport
Secondary Sidebar
SSRS Tutorial
  • SSRS Basic and Advanced
    • What is SSRS?
    • SSRS Versions
    • SSRS Cascading Parameters
    • SSRS Parameter
    • SSRS Group
    • SSRS Alternate Row Color
    • SSRS SQL
    • SSRS Subreport
    • SSRS Lookup
    • SSRS LookUpSet
    • SSRS Date Format
    • SSRS Report Builder
    • SSRS ISNULL
    • SSRS Opinion Panel
    • SSRS linked report
    • SSRS DateDiff
    • SSRS Dashboard
    • SSRS IIF
    • SSRS Reports
    • SSRS Number Format
    • SSRS Page Break
    • SSRS multi-value parameter

SSRS Subreport

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.

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.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

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.

All in One Software Development Bundle(600+ Courses, 50+ projects)
Python TutorialC SharpJavaJavaScript
C Plus PlusSoftware TestingSQLKali Linux
Price
View Courses
600+ Online Courses | 50+ projects | 3000+ Hours | Verifiable Certificates | Lifetime Access
4.6 (86,560 ratings)

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

This is a guide to SSRS Subreport. Here we discuss the introduction, how to create an SSRS subreport? and examples. You may also have a look at the following articles to learn more –

  1. SSRS Versions
  2. What is SSRS?
  3. SSRS Interview Questions
  4. Python String to Float
Popular Course in this category
SQL Training Program (7 Courses, 8+ Projects)
  7 Online Courses |  8 Hands-on Projects |  73+ Hours |  Verifiable Certificate of Completion
4.5
Price

View Course
0 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

ISO 10004:2018 & ISO 9001:2015 Certified

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

EDUCBA
Free Software Development Course

C# Programming, Conditional Constructs, Loops, Arrays, OOPS Concept

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

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

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

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

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

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more