.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to pass value from main report to sub report

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :Sql Server
I need pass sub report calculated  value in main report  using crystal report please help me

View Complete Post

More Related Resource Links

Using Report Parameters to pass data from a subreport to the main report?

I am creating a report where I need to use a subreport to pass data to the main report from a different dataset than the main report is using, I need to have the data from the subreport grouped on a field from the main report which is using a different dataset. I think I need to use a Report Parameter to do this but am struggling with figuring out how to set the parameter correctly. any useful advise would be appericated.
Stacey P. Shoemaker

How can I pass a parameter into my report?


I looked all over the forums, spent about a day on it, found numerous people having similar problems passing a parameter, but all the solutions I found so far were partially incomplete or incompatible to my project. I tried using a few of the "solutions" and they generated exceptions. I'm using straight ASP.NET so far with no c#. Is there a way to do it without code behind?

If someone suggests a solution I would be very grateful! Laughing I'm certain that if you provide a complete working example that others in the future will be very grateful as well.

Here is what I have thus far:

I used studio to create an .ASPX web form, and I used the report wizard to create a .RLDC file on the .ASPX page.

When I execute it, it works! Beautiful... Now how do I pass it a parameter?

So this is what I have below (which works), but I want to pass in a single int32 parameter to the stored procedure usprptGetData in which it is based.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="My_Reports_Guarantor" %>

Formula on Main Report Using a Field from Subreport

Hi, 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,      

Pass parameter to Hidden Field in SSRS Report

Hi, I have Two Columns in a Table Say As Table1 Column1 = Text Column2= id My SSrs Report has two parameter values as Column1 and Column2. Column2 should be hidden SELECT DISTINCT COlumn1 FROM Table1. i have passed this query dataset to Column1 parameter. Now My requirement is that, when ever column1 drop is selected. the hidden field column2 should fecth the corresponding ID. this column2 has Storeprocedure which will Display the Output when View Report button is clicked Thanks, Saraswathy

Three subreports in a main report(RDLC file)

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.

Sub report query based on main report (Microsoft Report Viewer)



I searched the forum but couldn't find anyone with the same problem with me.  They were close but didn't help me solve my issue.

I'm trying to learn how to make the sub-report get data from SQL Server based on a primary key passed from the main-report.

An example:
Main report displays all student names and the sub-report would display all their contact phone numbers.

A visual:
Bobby Smith

Home Phone: 555-1212
Cell Phone: 555-2323
Work Phone: 555-3434

Jane Doe

Home Phone: 555-2020
Cell Phone: 555-3030
Work Phone: Null

Ginger Doe

Home Phone: 555-5062
Cell Phone: 555-9586
Work Phone: 555-2356

Student ID   |   Name
1                | Bobby Smith
2                 | Jane Doe
3                 | Ginger Doe

Phone ID &n

Unble to pass date parameter to "Go to Report " ?


Hi ,

I have Report A need to go from Report A to Report B passing multivalued parameter and date parameter as well , I do not have any problem passing  Multivalued parameter but cant pass date parameter from Report A and Report B .

Report A : Date parameter properties

name : date

Data Type : Date/Time

Default value =Today()

Report B : Date parameter properties

name : date

Data Type : Date/Time

Default value =Today()

Go to Report action ,Expression used to pass date parameter  from Report A to Report B


Unable to pass appropriate date parameter if changed from default value from ReportA to ReportB .

Assistance would highly be appreciated !!

Thanks .

Rajkumar Yelugu

Exporting in PDF or Excel for a main report and the related sub report



I have created a main SSRS 2005 report from what it is possible to call some subreports. Is it possible export in PDF or Excel also the subreports when I require the export inside the main report?

Many thanks

Error processing report with embedded subreport while leveraging interactive sorting in main report.


This error only occurs with the Report Viewer v10 control...fine with v9 and occurs on both SQL Server 2008 SP1 CU9 and 2008 R2.  I have a report that has an embedded subreport object, and the subreport renders properly until I click on any textbox with interactive sort enabled in the main report...at which time I receive the following error message in the subreport object:


reportrendering!ReportServer_0-2!d98!10/06/2010-11:38:22:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.RenderingObjectModelException: One or more parameters were not specified for the subreport, 'FilterList', located at: Common_SubReport_FilterList., ;

 Info: Microsoft.ReportingServices.ReportProcessing.RenderingObjectModelException: One or more parameters were not specified for the subreport, 'FilterList', located at: Common_SubReport_FilterList.

processing!ReportServer_0-2!d98!10/06/2010-11:38:22:: e ERROR: An error has occurred while processing a sub-report. Details: One or more parameters were not specified for the subreport, 'FilterList', located at: Common_SubReport_FilterList. Stack trace:

   at Microsoft.ReportingServices.OnDemandReportRendering.SubReport.CheckRetrievalStatus(Status status)

   at Microsoft.ReportingServices.OnDemandReportRendering.SubReport.RetrieveSubreport()


How to pass multiple filter parameters to moss report viewer from custom filter provider


I have written a custom filter provider webpart which implements ITransformableFilterValues to pass parameter value to moss report viewer webpart.

However, this interface only allows to pass one parameter. Please can someone guide me through correct resource which allows my custom filter provider webpart to pass multiple parameters to report viewer. E.g if my report has 5 parameters then my filter provider webpart should allow me to make connection with report viewer and pass all 5 parameters.

How do I - pass multiple params from multi-select drop down on one report to another via action


Report 1 - 3 params:  @Status =Y,N  @FromDate, @ToDate.  Report one shows 2 cols (Status, Total). 

 @Status gets values from shared dataset - getStatus

Status      Totals
[Status]    [Total]

I created an action [Total] when clicked runs another report that accepts the same 3 params (Status, FromDate, ToDate) and works fine if i only select one of the status' from the status param drop down.

I am trying to create an action on [sum(Total)] that will run the same 2nd report with both status' selected.  Show it should show me details of all Y and N

The second report will work if i set the 2nd report @Status param to no default value.  But i want a user to be able to run the 2nd report by itself if needed so i set the @Status param to Get Values from a Query, which get the same dataset as report 1 which is getStatus.  It will not populate the 2nd report Status field when I do this.  I am forced to set it to no default values.  Is there a way to pass both the Y and N from report 1 to report 2 and still keep the drop down multi-select box on report 2 for Status?


How do I call an SSRS Report from a stored procedure, and pass parameters?


Hi all,

I have a Report, that I want to run ad-hoc from a Stored Procedure. 

I want to render this report to PDF format, and save it to a drive.

The difference between this post and most threads I've seen is I don't want to run a stored proc within the report and send parameters to the stored proc.

I DO want to call a report FROM the stored proc, and send parameters TO the report.

How can I do this?

Many thanks,


Group headers of the main report are not repeating when used with subreports


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.



Good process to pass an explicit prefiltering to a sub report



I try to pass my parameter CRM_FilteredSystemUser from my main report to the sub report.

So it's working fine in the main report. And it's working fine as parameter entered by myself testing straight in the subreport.

But I don't know how to set this parameter in the subreport to make this work.


In my main report I pass the CRM_FilteredSystemUser =Fields!systemuserid.Value to the sub report.

My main report has as report parameters : CRM_FilteredSystemUser, Non-queried : SELECT systemuserid,eu_securityrole, eu_reporthubname, fullname, businessunitidname FROM FilteredSystemUser

I'm using as well this parameter in my subreport : ...SELECT  businessunitidname,  EU_attendanceentry.*
FROM EU_attendanceentry INNER JOIN  ('+@CRM_FilteredSystemUser+') ....

In my subreport I've a report parameter :  CRM_FilteredSystemUser / Non-queried : =Parameters!CRM_FilteredSystemUser.Value

But doint that I've the error: An error occurred while executing the subreport ‘subreport1’: The definition of the report '/Calls per field Day_SubReport' is invalid.


I'm very confused there,

prompt/display "AGAIN" Report Parameters on Main Report



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

SSRS 2008 - Subreport passing a value back to the main (master) report



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.



Can I have 3 different tables in a report? And, can I pass 3 temp table to SSRS as source for these

I'm using BI 2008 and sql 2005 and 2008.  Is there an example to show me?  Thanks.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend