Home » Visual Studio

How to display the subreport in main report in RDLC local module

I build a main report, and subreport, both of them work fine seperately, now i want to display the subreport in main report using subreport control in toolbox window. However there exist a error in the main report when view via browser, which means the subreport doesn't work. Could anyone help me out? Thanks in advance.



4 Answers Found


Answer 2

Error: Subreport could not be shown.

Answer 3

Could anyone give me the rigth direction and relevant code in code-behind to utilize the subreport  in main  report in RDLC local  module report? Thanks.

Answer 4

From the link that BernieHunt already gave you, three possible reason:

ReportViewer could not find the .rdlc corresponding to the subreport. One or parameters expected by the subreport  were not passed by the main  report. Data for the subreport was not supplied. (Did you forget to handle the SubreportProcessing event?)

Yours is likely reason #3. If you don't supply the data for the subreport in SubreportProcessing event (sample code provided), then you'll get this error.


I want to display the footer from subreport on main report. The sub report footer displays the Global Page number. I found out that only body of subreport can be displayed in Main report. But Global Page number cannot be placed in body. How can I display footer of subreport in Main report or display the Page number of subreport in Main report?

Hi All,

I have one main report(rdlc file) which contains three subreports(mapped to three different rdlc files). The functionality am working in is that in a button click(with parameter passing) the main report loads. The main report contains three columns which is of type link. Each column is mapped to a subreport. Once the link in a column is clicked the main report along with the respective subreport should get displayed. Again, if the link field of another column of the main report is clicked, the main report and its respective subreport should open and the previously opened subreport for the other column should not show. The visibility of the Subreports must change according to the click of the link in the main report.

I have declared SubReportProcessingEvent as a sub report processing handler shown below.

AddHandler rvCompareLabels.LocalReport.SubreportProcessing, AddressOf SubReportProcessingEvent

Public Sub SubReportProcessingEvent(ByVal sender As Object, ByVal e As SubreportProcessingEventArgs)

End Sub

I understand that in this method i have to do the code behind for displaying the subreports.

But am confused as to how can i identify which link is being clicked and how am i supposed to add the datasource  for the subreport that should open. How will i give the condition such that  for the link that is clicked only the subreport mapped to that link opens.

Has anyone came across a similar kind of requirement or can you give me any idea.

Any suggestions will be really helpful.


I am working with rdlc for Windows client application.I am trying to generate a receipt for all clients at once. My subreport is a receipt for a single client. While, my main report has List contol of rdlc which passes the clientID to subreport to get details. Bascially, subreport has to iterate  for every client from Main report. But I get no error and no data from subreport at all. After further investigation I found out that my Subreport processing event is never triggered. Even though I have an handler for that.

Can anyone help me ? Give me an working example ?



I'm having some troubles defining and passing report parameters to subreports in VS 2010. In VS 2008 in the design view I was able to right click and define the report parameter and have it passed through.

VS 2008 Context Menu  VS 2010 Context Menu

In VS 2010 that prompt is missing. So my question is, how can I pass a value from a parent report to a subreport in VS 2010?


I am working with rdlc for Windows client application.I am trying to generate a receipt for all clients at once. My subreport is a receipt for a single client. While, my main report has List contol of rdlc which passes the clientID to subreport to get details. Bascially, subreport has to iterate  for every client from Main report. But I get no error and no data from subreport at all. After further investigation I found out that my Subreport processing event is never triggered. Even though I have an handler for that.

Can anyone help me ? Give me an working example ?



Hi All,

I have a report with 12 subreports (Jan to Dec)

The main report has employee column, other columns (i.e. Jan to Dec) which has some integers values specific to the employee.

The integer column is nothing but a subreport onclick of which we need to show the employee details for that month.

The subreport has two parameters (employeeid and month).

How should i pass parameters for subreport in the code.

Please help. Its urgent.




I need to share the result of a calculation from a subreport to the main report


I need to group data from a secondary dataset the same and the primary dataset.


If I have a main report with a Calulated sum and a subreport with calculated sum, is there any way to calculate an avrage between these two in Reporting Services The sub report is embedded in the mainreport. When I say Calculated sum I mean that in the reports I have , I have done a count on filelds. I havent seen anything on this subject so any guide is appreciated.




Is it possible to use a subreport with three parameters passed to it (i tried it, it works fine) but then I want to make the count of this subreport, so i need in the group below to add this subreport again inside again, but passing less parameters, so i modify my query like that :

SELECT    ...FROM ... WHERE ...
and (CRMAF_FilteredContact.ownerid = @ownerid  OR @ownerid IS NULL)
ORDER BY CRMAF_FilteredContact.OwnerIDname

When I try it with a null value in the subreport, it works fine, but when I try it from  the main report, so I tried to remove the ownerid parameter, I tried to put it at blank, I tried to put NULL but I always have an error, the report start fine but then, on the total, i've the error "error subreport could not  be shown".

Maybe I don't need to add a subreport cell but just link this cell with the other cell containing the subreport ???

Thanks for your help,



I try to use a value coming from a cell which contain a subreport.

I need to create a formula using this value.

So I tried :

=Code.CalcPct(CountDistinct(Fields!s_contactsvisited.Value), Globals!CALL_SubReport)

But I've an error:

[rsRuntimeErrorInExpression] The Value expression for the textbox textbox9 contains an error: Specified argument was out of the range of valid values.

Thanks for you help,





Hi all,

  I have a SQL server 2008 report which has a main report and 2 subreports embedded. Each of the subreports are placed under a main group and the group headers of the main header are made to repeat with RONP property and Keep together properties set to true. If the subreport's data fits in one page the group headers are repeated. But when the subreport's data spans to more than one page the group headrs of the main report are not repeated. Please let me know if there is a workaround to achieve the same. I have tried putting the group headers in the page header, but this approach does not work fine. Please let me know if this can be achieved using coding.





Looking for a way to pass a calcuated value or Sum from a Subreport back to the Main Report.   Is there anyway to do this.  In past posts, with the most recent being 2008, it is said that this feature was not available or included in SSRS.

Using SSRS 2008.




Hello all,


I am working on a report wherein, I call a subreport(rdlc) for every item from main report(rdlc). Basically, I am defining subreport inside a list control.  But, I do not get any data from subreport in final result. Has anyone come across such a situation or know whether I am missing something while I am looping a subreport inside a list/table control?


How can I add multiple instances of a subreport to a main report (rdlc) at runtime? Am I doing it the wrong way? 


The main report lists participants registered for summer camp, and the subreport that loops inside the main report is essentially a receipt for payment of summer camp fees (one for each participant).  So each subreport instance has different data for different receipts, but has the same fields and thus is designed as a single subreport pulling data to fill the fields based on the participant list item of the main report.  Oh, and by the way I am using this for a windows client, not web, at this time.


Thanks in advance for any help provided.  I have looked everywhere and cannot find the answer to this complex report style but it seems like it must be possible in ReportViewer. 

I am a Systems Analyst II working with VB.NET and SQL Server 2005 for a Florida county since 2008.  Forgive my newbie-ness!  I was working for the DOE in an environment with PHP and MySQL from 2003-2008, so I'm still kinda new to the .NET world.

I have a subreport that counts how many poeple that meets some simple conditions. This count returns a number or a zero that shows up on the subreport. I use Nz function and it works. However, when I put the subreport into my main report, the whole subreport won't show up if the count is zero. Do you know how to make it show up in the main report with zero (0) if there are none of people. Thank you for your help!  

Dear All,

Is there a way to display superscript in RDLC local mode report. Like I want to display meter cube (m<sup>3</sup>)

in the RDLC report data.

Thanks in advance for all your help and suggession.




I have main report with 3 report parameter ( start date, end date & drop-down list series of id's) by selecting these three paramters users can view the main-report.

Now inside the main-report I have link-report which I have implemented the functionality by using Text-Box and navigation tab "Jump to report" also selected "parameters" under same navigation tab with which I want to sent Report Parameters value to run link report successfully.

And from link-report I can come back to main-report by hitting "back to main-report" link with the same Report Parameters values.

Everything is working fine, it means I'm able to go back and forth by selecting different values from the main-report Report-Parameters values and can come back from link to main report with the same Report Parameters values.

So my question is regarding coming from link-report back again to main-report (2nd trip):-

When I hit on the back link, it goes to the main-report, but all the 3 Report Parameter's promts on the Main-Report aren't display; with this users can't change the values into the Report Parameters to accomplish that they need to execute the the main-report again to display the Report Parameters, so instead of asking user's to execute again how can I display the Report Parameters while coming from link-report back to main-report.

I hope my question is quite genuine.

Please help me out? Please let me know if you need further more information.







I have an asp.net web application, wherein I've created an RDLC file. There's an aspx web page which has a reportviewer control used to display the said report data. within this form there are certain parameter value's that are passed to fetch appropriate data from SQL.

What's happening is when I debug or run the application from VS it shows me the report and data appropriatly.However, when installed on the machine using an MSI or dirctly published, I can see the reportviewer control on the web page but there is no data displayed within the control

I am using IIS 7 on windows 7 OS


Dear all !

I have 2 parameters in the RDLC report FromDate and ToDate. i have a vb.Net form in which a report viewer, 2 datetimepicker are dopped. 

In the RDLC report i have added a header in order to show up the date range and have defined the expression in 2 text boxes of those 2 parameters. yet on execution it is displaying default from n to date been with the datetimepicker fields irrespective of changing the date values on every time refreshing the report.

How can we bring the date parameters in the RDLC report? 




I've got 2 folders:



In the Finance folder I have a Sales report that has 3 subreports, and a salesregion parameter.

I created a linked report in /Japan to /Finance/Sales, hide the salesregion parameter, and set the default to Japan, so they can only see their region's sales data.

But when a Japan user runs the Sales report, they get Error: Subreport could not be shown because they do not have access to the /Finance folder. Any ideas?


Visual Studio 2010 report designer:

How can we put the Plus sign off if there are no records available in the subreport? (This option is enabled by check marking "Display can be toggled by this report item" prompt at the Sub report properties dialog box.



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure