Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [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]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Collapse]Snap
   [Expand]Product Information
   [Expand]Getting Started
   [Collapse]Fundamental Concepts
    [Expand]Graphical User Interface
     Supported Formats
    [Expand]Developer Guidelines
    [Collapse]Data Acquisition
      Data Source Wizard
      Snap Mail Merge
      Query Builder
      Master-Detail Relation
      Calculated Fields
      Parameters
    [Expand]Data Shaping
   [Expand]Examples
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Parameters

This document describes the main concepts for using parameters in Snap, and provides examples of their use in various tasks.

The document consists of the following sections.

Expanded Create Parameters

You can manage the report parameters available for a Snap document using the Parameters dialog.

To invoke the Parameters dialog, right-click the Parameters node (or any of its sub-nodes) in the Data Explorer and select EditParameters in the invoked drop-down menu.

The Parameters dialog allows you to add and remove parameters using corresponding buttons. Alternatively, you can add or remove a parameter by right-clicking the parameter in the Data Explorer and selecting the required action in the invoked drop-down menu.

Select the newly added parameter and specify its properties in the properties grid. Be sure to specify the proper parameter type based on the parameter's intended use.

Expanded Pass Parameter Values

After a parameter is created, it can be used in different ways during report generation. Below is a list of tasks that can be solved using parameters.

  • Data Binding

    To display a parameter's value in a report, drag the parameter from the Field List and drop it onto the Design Surface.

  • Filtering

    You can use a report parameter as part of a filtering expression to filter the Snap document data at either the report level or the data source level.

    To filter the Snap document data at the data source level, do the following.

    1. Invoke the Query Builder for the data source that you wish to filter.

    2. In the Query Builder window, click the Filter button to invoke the Filter Editor.

    3. In the Filter Editor, construct an expression where the parameter's value is used as a filtering criterion. To access the parameter, click the icon on the right until it turns into a question mark.

      Click OK to exit the dialog.

      The SQL query generated by the query designer will be updated to reflect the specified filtering.

      Important

      Manual SQL editing is not allowed by default. Enabling custom SQL queries may lead to inadvertent or unauthorized modifications to your data/database structure. Before you decide to allow manual SQL editing, we recommend you to follow best practices and implement the appropriate end-user read/write permissions at the database level.

      If for some reason you have to enable custom SQL editing, set the SnapControl.Options.DataSourceWizardOptions.SqlWizardSettings.EnableCustomSql option to true.

      Note that only SELECT statements are allowed in the text. To override this restriction, handle the SnapControl.ValidateCustomSql event.

    In a similar way, you can use the Filter Editor to filter the Snap document data at the report level. In this case, to invoke the Filter Editor, click the Filter button that resides on the List tab of the contextual Data Tools toolbar category.

  • Calculated Fields

    In addition to standard data fields, parameters can be used in expressions for calculated fields. The only difference is that the data field is inserted into the expression's text using its name in [square brackets], while a parameter is inserted using the "Parameters." prefix before its name.

Expanded See Also

How would you rate this topic?​​​​​​​