Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8857873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:41:46+00:00 2026-06-14T14:41:46+00:00

I have a web page that displays an RDLC report in a ReportViewer. For

  • 0

I have a web page that displays an RDLC report in a ReportViewer. For each record in the main report there is a subreport.

I need to pass the data from 3 fields from each record in the main report as a parameter to the subreports stored procedure.

the main report works but it just says

Error: Subreport could not be shown

I have all the parameters defined in both reports, and I’m handling the localReport_SubreportProcessing event

C# Code

    protected void Page_Load(object sender, EventArgs e)
{       
    this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Refs_MainDs", SqlDs_RefsReportsMain));
    this.ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(localReport_SubreportProcessing);
}
void localReport_SubreportProcessing(object sender, SubreportProcessingEventArgs e)
{
    e.DataSources.Add(new ReportDataSource("Refs_SubDs", SqlDs_RefsReportsSub));
}

ASP Code

<rsweb:ReportViewer ID="ReportViewer1" runat="server" Height="800px" Width="100%" Font-Names="Verdana" Font-Size="8pt" BorderColor="#666666" 
    BorderStyle="Solid" BorderWidth="1px" AsyncRendering="False" ShowPrintButton="False" >
<LocalReport ReportPath="Reports\EOD_Refs_MainReport.rdlc" >
    <DataSources>
        <rsweb:ReportDataSource DataSourceId="SqlDs_RefsReportsMain" Name="Refs_DataSource" />
        <rsweb:ReportDataSource DataSourceId="SqlDs_RefsReportsSub" Name="Refs_DataSource" />
    </DataSources>
</LocalReport>                             

AND

<asp:SqlDataSource ID="SqlDs_RefsReportsMain" runat="server" ConnectionString="<%$ ConnectionStrings:AlphaConnectionString %>" 
    SelectCommand="rpt_RefsReport_Main" SelectCommandType="StoredProcedure">
<SelectParameters>
    <asp:QueryStringParameter Name="RefsID" QueryStringField="RefsID" Type="String" />
</SelectParameters>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:41:47+00:00Added an answer on June 14, 2026 at 2:41 pm

    I needed to change the data set for each report they all still use the same data source and then in code you need to set the parameters for each data set

    <rsweb:ReportViewer ID="ReportViewer1" runat="server" AsyncRendering="False" ShowPrintButton="False" >
    <LocalReport ReportPath="Reports\Report_MainReport.rdlc" >
        <DataSources>
            <rsweb:ReportDataSource DataSourceId="SqlDs_ReportsMain" Name="EOD_Summary_DataSource" />
            <rsweb:ReportDataSource DataSourceId="SqlDs_ReportsMid" Name="EOD_Summary_DataSource" />
            <rsweb:ReportDataSource DataSourceId="SqlDs_ReportsSusp" Name="EOD_Summary_DataSource" />
            <rsweb:ReportDataSource DataSourceId="SqlDs_ReportsRef" Name="EOD_Summary_DataSource" />
        </DataSources>
    </LocalReport>                             
    

    <asp:SqlDataSource ID="SqlDs_ReportsMain" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="rpt_HighLevel" SelectCommandType="StoredProcedure">
    <SelectParameters>
        <asp:QueryStringParameter Name="Key" QueryStringField="Key" Type="String" />
    </SelectParameters>
    

    and so on for each Report Data Source

    in C#

    protected void Page_Load(object sender, EventArgs e)
    {       
        this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("MainLevelDs", SqlDs_ReportsMain));
        this.ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(localReport_SubreportProcessing);
    }
    void localReport_SubreportProcessing(object sender, SubreportProcessingEventArgs e)
    {
        e.DataSources.Add(new ReportDataSource("MidLevelDs", SqlDs_ReportsMid));
    }
    

    Don’t know if it’s the correct way to do it but it works for me!

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET web page that displays a variety of fields that need
I have a web page that displays a list of documents stored on the
I have a web page that displays dynamic data which changes every 2 seconds.
I have created a web page that displays a table. Most of the cells
I have created a web page that displays a table. Most of the cells
We have an ActiveX component that displays a Web page in an Internet Explorer
I have a web page that is displays differently in Firefox and Safari (IE
I have an asp.net web page that displays data that was returned from the
I Have a UIWebView that displays third party web page (not a page I
I have a web page that displays a list of events. By default all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.