.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 report parameters by report viewer

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net

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

View Complete Post

More Related Resource Links

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

Report Viewer Control and Passing Paramaters

Hi Guys, I have a situation where I am created a WEB APP that has a submit button on a FORM on the first ASPX page.  I have some VB code behind that to generate Header and Lines records in two tables with a HEADER ID as my PK.  I have another ASPX page which has the Report Viewer control on it and prompts me for the HEADER ID and displays the report correctly when I manually enter the HEADER ID.What I am now trying to achieve is when the user clicks the submit button on the FORM I want it to redirect to the other ASPX page and pass through the Header ID as a Parameter and automatically display the REPORT. Can somebody please point me in the right direction to achieve this.ThanksJoel 

Passing parameters from ASP.Net web page to SSRS report

I have a web page that displays some data.  The user first selects a date range on the web page and then can edit some data.  When they click a submit button, I want to run a report.  But I would like to pass the start date and end date values that the user already entered on the web page to the report.  Is this possible?  Can I use the value of a session variable in the report? Bob

Problems passing parameters to SSRS report from ASP.Net web page

I have a web page that displays some data.   When they click a submit button, I want to run a report.  But I would like to pass the start year/month and end year/month values that the user already entered on the web page to the report.  Here is what my url looks like when the report is displayed: http://xyzserver/Reports/Pages/Report.aspx?ItemPath=%2fReports%2fDevicesAllNew&rs:Command=Render&StartYYMM=201007&EndYYMM=201008 But my report displays the 2 textboxes for my StartYYMM and EndYYMM parameters as empty.  What am I doing wrong?  I did a google search and I saw something about using ReportServer instead of ReportManager.  I notice at the top of the browser when I run my report, it reads "Report Manager - Windows Internet Explorer".  Is this correct? Bob     Bob

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.

Passing Report Parameters to SubReport in VS 2010 RDLC


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?

Passing parameters between 2 SSRS reports deployed in report manager



I have created 2 reports in SSRS. In my 1st report there is a tablix, which contains many rows. The text in these rows act like hyperlink and upon click navigate to my 2nd report. This functionality is working fine in Visual Studio and also in report manager. But as soon as I deploy my reports in SharePoint site (using a page viewer web part), this functionality breaks. I can see when I take my mouse near the text in the Tablix it shows a URL like http://IP Address/Reportserver/

It's evident that the URL here is not forming correctly. Can anyone help me out in this issue. In my report for navigation purpose I had used Action -> Goto Report (report 2) and passing the parameters there.

Thanks in advance,


Passing Parameters like >, <, = on the Report for filter records



I dont have any idea how to proceed please help me out.

I have a Table like

ProductName        Product price

A                          2

B                          10

C                         5

I need a report where i can select the ( Greater than ,Greater Than or Equal to,Lesser than,Lesser than or Equal to, Equal To ) from the drop down list box.

and pass the credit 5. so it will get the desired results.

please advise on this .




Passing Parameters to the subreport (Crystal report)


I have a report that has a subreport in it.

My Problem is to pass the parameters to the child report without prompting the user for the parameters.

I did the steps below

Step 1: Create the sub report parameter in the main report

Step 2: In the Sub report links, link the sub report parameter with the corresponding main report parameter created in step 1

Can someone tell me how the pass the parameters using CSharp. 

My application is being able to load all the reports but  the ones with subreport the use have to enter the parameters.

Can someone help me with a live example.

Im using Crystal report that is embeded with visual studio 2008,


Crystal report passing parameters to sub report from csharp

Im not being able to pass parameters to the subreport C# below is the code, i dont want the popop of parameters to appear.
Development environment is CSharp, using Crystal reports and SQL. Both reports parent and sub report has the same parameters.
Anyone can help?

     public void PrintReport(ReportDocument crReportDocument, string ReportTitle, string ReportSpName)

Passing report parameters to a query using a WCF data source


Hello everyone,


I am attempting to pass report parameters to my query. My report's data source is a WCF web service. I can run normal queries fine, but I have found that without the know-how to pass parameters to my query I am limited with my capabilities.

Assume a string parameter named "Name" with a specified default value of "Jmachol90", how would I pass that into the following query at the designated place:




          <Method Namespace="http://schemas.microsoft.com/sqlserver/masterdataservices/2009/09" Name="SecurityPrincipalsGetRequest">


          <Parameter Name="Criteria" Type="XML">









Passing Parameters Into A Report



Morning to all,

I have a question which I hope somebody out there can help me with. I have a report which uses the following query;

select name
from people
where band in(@band)

I know I can add a multi-value parameter to the report to select all required bands, but I do not want to give the user the choice to select said bands for themselves.

For example if Jeff is responsible for bands 1 and 2 I would like the query to reflect that without Jeff having to input any information i.e.

select name
from people
where band in(1,2)

I have looked into passing parameters via URL, adding and hiding the parameter on the report but can only find very basic stuff like adding &band=1 after Render and am unable to find a way of specifying more than one value.

I am open to any suggestions via URL or programmatically as I am calling the report from within a .Net application.

Thanking you for your help in advance and for taking the time to read this post.


Creating Dataset Dynamically in c# and passing to Report Viewer..



 It sounds silly!! but i can't figure out how to get the data to the report viewer from the dataset that i have created in c#. because my dataset is dynamic and the columns would vary every time when i load into the report viewer. i read thru most of the articles but was unable to figure houw to work this out.

the data set for eg i created is:-


private DataSet getDataSet()
   string sql = "";
   OdbcDataAdapter adptr = new OdbcDataAdapter(sql, _connection); 
   DataSet ds = new DataSet();
   return ds;

and from this dataset i have to create the report viewer. this is created in cs page of the aspx page where the report viewer is. also i have a blank report.rdlc. please help me thru this...

thanks in advance..



How to use report viewer 2010 in VS 2008


I downloaded report viewer 2010 from here


Now I want to actually use it in a website.  How do I do that?  Do I have to modify some part of web.config?  Specifically, what do I need to change?


populate report viewer by code


Hi all

I have a button "Show Report" to show some data from table

what I should write under this button to populate the reports ?

Report viewer error


  • An error has occurred during report processing.
    • A data source instance has not been supplied for the data source "PatientDetailsReport_DataTable1".

  • i am using two to three rdlc reports in my page for single report viewer when i first load the page i got the output in reportviewer but when i try to load other rdlc report then am getting the above mentioned error.i cleared all the datasources for the report viewer before giving new datasource but am getting the same error pls someone help

SSRS Report viewer + Remove


I am running the report from SSRS report server in the view i am finding that the window title is Report Viewer - Windows Internet Explorer.

How to remove this name and get the name of the report over there.

I am using java at the back end to call the repot through url.

Please help 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