Skip to main content
A newer version of this page is available. .

Pass Parameters from the Client to a Report in Web Forms Application

Handle the Page_Load event for a page that contains the Document Viewer. In the event handler, create a new report instance, find the parameter in the report’s Parameters collection, and obtain the parameter value from the Request.QueryString property.

using DevExpress.XtraReports.Web;
//...
protected void Page_Load(object sender, EventArgs e) {
    XtraReport1 report = new XtraReport1();
    report.Parameters["parameter1"].Value = Convert.ToInt32(Request.QueryString["parameter1"]);
    ASPxWebDocumentViewer1.OpenReport(new CachedReportSourceWeb(report));
}

Run the application and pass the parameter value to your web page as shown below:

‘Viewer.aspx?parameter1=100’

You can also pass values for multiple parameters. Separate parameter values with the & character:

_{WebPageURL}?{ParameterName1}={ParameterValue1}&{ParameterName2}={ParameterValue2}_