Friday, March 23, 2012

parameter

Dear all,

May I know is it possible for me to pass the parameters from aspx page to rdl? If so, then how to do that? FYI, the data displayed in my rdl page is depend on the various parameters pass in from that corresponding aspx page. Thanks

Levine

What exactly do you mean?

|||

I have a class file in visual studio 2005 and I'm thinking of using it to pass the parameters to my rdl (sql server 2005) but I don't know how to made the rdl accept (get) the parameters pass to it. Thanks

|||

by the way.. did you use reportviewer control with rdlc or rdl?

If you are using rdlc then this is how i understand

tell me if i'm wrong, did you mean that you want to display a dynamic data (rdlc) in your page depending on the parameter?

scenario:

In my page ,I have drop down list for year wherein a user can choose an options, if user select an specific option then it will display the data in reportviewer based on the year selected?

|||

this is easy

First it is necessary to ccreate aReportParameter object (be sure you have a reference toMicrosoft.Reporting.WebForms). The contructor takes two string parameters one for the Name and one for the Value. A new parameter would look like the code below.

ReportParameter myReportParameter = new ReportParameter("Id",
Request.QueryString["Id"]);

Next, parameters on the ReportViewer are set using theSetParameters method. It takes an array of ReportParameter, so you would have syntax like the following.

MyReportViewer.ServerReport.SetParameters(
new ReportParmeter[] { myReportParameter });
 
you can use report viewer control which you can download from this linkhttp://www.gotreportviewer.com/
|||

Hello,

Thanks for the help. But what I'm trying to do is to create a rdl file which can accept the parameters which are passed from aspx page. May I know is it in a way that the rdl will have a "container" to get those parameters? Thanks again :)

Levine

|||

Have you tried using aspnet Reportviewer control?

No comments:

Post a Comment