.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

Passing parameter to Sub report Issue ( pls help)

Posted By:      Posted Date: September 20, 2010    Points: 0   Category :ASP.Net

Hi I have main report and one sub report. I used on dataset for main report and one for sub report. I am using Vs2005 .

Store procedures



I have setup the report added sub report in main report. I have also setup parameter from main report to sub report.

It works fine on reporting server.


When I am calling from Asp.net. I am getting error sub report could not be found.

here is my code

Report.SubreportProcessing +=

new SubreportProcessingEventHandler(SubreportProcessingEventHandler);

void SubreportProcessingEventHandler(object sender, SubreportProcessingEventArgs e)



e.DataSources.Add(new ReportDataSource("DataSetSubReport", GetDatasoure("dbo.GetSubReport ", e)));


View Complete Post

More Related Resource Links

rdlc report parameter passing

hi i am working on report project i am new in .net will some one help how to pass parameters in rdlc reports . the options for reprt parameter is not available in visual studio 2010 .Please help someone ..

passing parameter from one report to another (SSAS database)?


 I created two reports using SSAS Databse as the report datasource.I need to call one report from another report while clicking one of the textbox(text Box properties--> action --> Hyperlink GO to Report)

1) How should I pass the parameter from one report to another (bcos I should pass like this [Month].[Month Name]&[09] ) ?
2) How Should I pass the parameter if I am using hyperlink "go to URL" to call the report?


SQL 2008 Reporting Services Report Parameter and Analysis Services issue after upgrade

I have upgraded my SQL 2000 database and analysis server and SQL 2005 reporting services server to a new instance of SQL 2008 running database engine, analysis services and reporting services.

The analysis services database migrated successfully and I have got the database into a state where it processes fine but I am having the following problems.

- My Reports show in reporting services but the drop down list parameters are all empty.
If I change the parameter in report builder to use the display name instead of the uniquename then the drop down list populates and works until I select a value that contains a space character and then it reports a problem with the dataset used by the report.

Query for the dataset used to populate my parameter.
with member [Measures].[GroupUniqueName] as '[Site].CurrentMember.UniqueName' member [Measures].[GroupDisplayName] as'[Site].CurrentMember.Name' select { [Measures].[GroupUniqueName], [Measures].[GroupDisplayName] } on columns, { [Site].[Group].members } on rows FROM [Invoice Reporting]

Query used by the report, filtering on the selected parameter value from the drop

Passing Parameter to A Report


There is a main report which takes 3 multi selectable parameters. These are sended to subreport with no problem with the expression of =Parameter!Retailer.Value but I have some other parameters in the other report that I send depending on which cell I click on main report. For example these values are passed like =Fields!Gender.Value. And i want the subreport parameters to be selected as well and parameters are takin from a query. For example I set the first three parameters in main report and clicked on a cell whick is written 'Male', I want the parameter in the subreport to be selected 'Male' and show Female as an option. I couldn't solve my problem even if I tried everything. It would be nice if somebody solves it. thanks a lot

passing report parameter thorugh url



Im facing problem in passing report paramter over url. Can any1 help me. Im using ssrs2005. I think this feature is not enabled in ssrs 2005 but enabled in ssrs 2008.  SSRS is confiured with sharepoint integration mode. Please help me out foe passing parameter to reportviewer over url




Hope you doing great.

I have an outstanding issue with me regarding SSRS.

I have one main report and 4 subreport into it and corresponding SP related to each reports. When eve i run the

main report, it prompt for the user INPUT parameters depending on the SP. Consider 3 parameters.

What i wanted is these 3 paramter should be taken by all the subreport attached and should not prompt for error.

I tried, each report having the same parameter, some report are not shown with an error "SUBREPORT not SHOWN".

I only want that as soon as i enter the parameter in the main report, all the sub report attached should take those

parameter and desplay the complete report.




Crystal Report parameter value window.


 Hi friends,

   I am using Crystal report which displays the result of stroed procedure which have 2 paramater.

  When i run report it shows two window for getting each parameter.

  My need is, can i have one window for getting all the paramter value for stored procedure.


  With Advanced thanks,






Crystal Report vs 2003 convert to vs 2008 parameter problem


Hi friend,

I have a project develop with Visual Studio 2003, when i convert the project to Visual Studio 2005 is work well. But when i convert to Visual Studio 2008, the crystal report when have pass parameter will prompt the parameter field to re-type then show the report.

But in this converted project i create a new report and pass the parameter is ok. That means i wan re-do all report @.@??

Does someone can help me solve this problem??

Thank you

Passing report parameters by report viewer


I have 4 parameters in which 3 are passed in report and 1 is passed through report viewer. I have made a parameter in SSRS called CandidateId to which I want to pass the value. The code for report viewer is:

 intReportID = Convert.ToInt32(Request.QueryString["ReportID"
 CandId = Convert.ToString(Session["CandidateId"
lblReportName.Text = dtReport.Rows[0]["ReportName"
SSRSReportViewer.ShowCredentialPrompts =false

 SSRSReportViewer.ServerReport.ReportServerCredentials = new
SSRSReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.


 SSRSReportViewer.ServerReport.ReportServerUrl = new

SSRSReportViewer.ServerReport.ReportPath = dtReport.Rows[0]


 Microsoft.Reporting.WebForms.ReportParameter[] theparams = new

theparams[0] = new
, CandId);
theparams[0].Visible = false

Passing Id in parameter


Hi, I am using url in my mvc application like /product/edit/5, should change it because users can

change id parameter and access different product as this Id directly refer to Id in product table, I have validation there for user to access product, what you suggest, what best practice can be for it ?

should I continue with it or should I change it as application has many users

Thanks you


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" %>

Preview Crystal Report from ASP.net without passing parameters


Hi Everyone,

Sorry couldn't think of any better Subject..

I am developing a User Reports Module using C#.Net using Visual Studio 2005. Basic purpose of this module is to allow user to be able to run their own Crystal Reports. i.e. if Users have their own Crystal Reports specific to their needs then we allow them to save them and view them from our user reports module.

So when user saves any report we save it on server and save the Physical path of that report in database. Now when user tries to view the report I get the location from database and load it. Which works ok. The issue now is those reports which have got parameters. 

I am not saving any information about parameters in their reports. So I do not have any information about Report Parameters.

This same application exists in VB6. What that VB application does is opens the Crystal Report and then Crystal report asks for needed parameters exactly as it will do if we try to open a crystal report using crystal report and preview it from there it asks for parameter values. 

How can I do that in C#.Net.

VB has got code like this

Global Appl As New CRAXDRT.Application

ssrs 2008 R2 - report parameter with no default set throws java script error

We have recently upgraded from SQL Server 2008 to SQL Server 2008 R2....I am experiencing a problem with my report parameters on my SSRS reports. It seems that my report parameters that I do not have a specified 'default' value throws a java script error when I try and run/render the report under R2.  As soon as I put a 'default' value on the report param, everything is fine.  However, that is not the behavior we need for our reports...the user needs to pick their selection. Can anyone shed some light on this, it seems to be an AJAX problem...I need to be able to have report parameters with a list of values, but no 'default' value on the parameter.

ascx control with passing parameter

i want to create a ascx control with passing parameter .i got followong code from stackoverflow<% Html.RenderPartial("~/Views/Shared/MyControl.ascx", {data model object}) %>i am fine above line but how can i design html control for this.sample code example would be great.

Displaying a Parameter Value in the report footer that corresponds with the parameterized data on ea

I've got a report that has only one parameter, it determines the department (or departments) to base the report on, the parameter is set to allow for multiple values. The report returns only on page per department, so the report could be anywhere from one to a hundred pages, one page per department. I've included a text box in the report footer that displays the report name and the parameter value, the expression looks like this: =Globals!ReportName & " For Department " & Parameters!Dept.Value(0)    I know that in this example the zero inside of the parenthesis of the parameter value is what is returning the actual value when the report is rendered, and I understand that the zero is value in the array of parameter values. What I'm looking to do is adapt this expression so that the parameter value rendered on each page corresponds with the data (departement) displayed on the specific page. So using the example of the data, if the user selected three departments in the parameter drop down, then each page that displayed the different department’s information would also display that departments name in the page footer text box. I'm thinking that each time a page is rendered that there is a group or global variable that can be called to provide this dynamically but I can't seem to find the information. Appreciate any help, Dan

Passing XML into a SSRS report from c#

I have a SSRS report that queries an XML file. I'm calling this report from c# and redering it as a PDF. The only way I can do this is to save the XMl into a path that is already defined in the report. My question is, can I send the XML into the report so that the report uses the parameterised report as the datsource?

Performance problem when passing a "nullable parameter"

Say @startDate and @endDate are my datetime parameters. If users does not want to limit the @startDate for example, he/she sends a null value to @startDate. Same goes for @endDate (and any other parameter). What I like doing: Select * From MyTable Where MyTable.Date >= IsNull(@startDate, MyTable.Date) And MyTable.Date <= IsNull(@endDate, MyTable.Date) The above looks nice as far as coding but when I look at the execution plan I'm surprised to see the my clustered index (that has it's first column as "MyTable.Date") is not used. instead I get an index scan. More frustrating is that the following works with an index seek and is much faster: Select * From MyTable Where MyTable.Date >= @startDate And MyTable.Date <= @endDate So what should I do? am I doing something wrong? I don't want to use dynamic sql because it's generally slower and prone to sql injection (is dynamic sql my only choise)? I don't want to use "if statements" because then i'd have to rewrite my code several times (in this case three combinations but some of my procedures have up to 8 "nullable" parameters). Or maybe there is another way of implementing what I call here "nullable parameters". obviously I preformance is crucial. thanks, Dror
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