[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Graphical User Interface
    Supported Formats
   [Expand]Developer Guidelines
   [Expand]Data Acquisition
   [Expand]Data Shaping
     How to: Bind a Report to an MDB Database (Runtime Sample)
     How to: Bind a Report to Multiple MDB Data Sources (Runtime Sample)
     How to: Bind a Report to a Dataset Populated from an XML File (Runtime Sample)
     How to: Bind a Report to Multiple List Data Sources (Runtime Sample)
     How to: Bind a Report to an MS SQL Server Database
     How to: Hide Data Tables in the Database Schema
     How to: Calculate a Summary Function
     How to: Create a Calculated Field
     How to: Limit the Data Supplied During Document Editing
     How to: Create a Snap Template (Runtime Sample)
     How to: Sort Data (Runtime Sample)
     How to: Group Data (Runtime Sample)
     How to: Filter Data (Runtime Sample)
     How to: Format Data
     How to: Pass Parameters to a Report
     How to: Pass Parameters to a Report (Runtime Sample)
     How to: Create a Master-Detail Report
     How to: Create a Multi-Column Report
     How to: Create a Side-by-Side Report
     How to: Create a Report with a Chart
     How to: Save, Load, or Export a Report
     How to: Add a Table of Contents to a Report
     How to: Customize the Data Source Wizard
     How to: Programmatically Mark the Data Source as Use for Mail Merge
     How to: Create a Snap Chart Programmatically
     How to: Bind a Report to an Object Data source (Runtime Sample)
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Pass Parameters to a Report

This tutorial describes the steps used to create a parameterized report. In this tutorial, we will create a string parameter and pass it to the report's filtering expression. You are neither limited by the number of parameters you can create, nor by the data type (e.g., string, date-time, Boolean, integer and double).

Follow these steps to create a report with parameters.

  1. Create a Snap application and bind it to the "Products" table in the sample Northwind database.
  2. To create a parameter, switch to the Data Explorer window, right-click the Parameters section and choose Add Parameter.

  3. Right-click the created parameter and select the Edit Parameters... action in the invoked popup menu.

  4. In the invoked editor, define the parameter name and assign an appropriate type to it. This type corresponds to the value that a parameter can receive (e.g., you cannot assign a string value to a numeric parameter).

    Next, assign a default static value to the parameter.

  5. Now switch to the List tab in the Main toolbar and click the Filter button.

    In the invoked FilterString editor, define a filtering expression (e.g., where the UnitPrice data field is greater than or equal to the Starting Price parameter).

    To access the parameter, click the icon on the right until it turns into a question mark, and then select your parameter from the drop-down list.

  6. To create a layout for your report, drop the ProductName and UnitPrice data fields from the Data Explorer onto the report's surface.

The parameterized report is now ready, and its data is filtered based on the specified expression that uses the parameter value to shape the report's data.

To view how your report will look on paper, switch to the File menu in the Main toolbar and click the Print Preview button.

If required, you can easily modify the parameter value in code. To learn more on this, see How to: Pass Parameters to a Report (Runtime Sample).

Is this topic helpful?​​​​​​​