v2.1.0
v2.1.0v2.0.0v1.2.0

Report Parameters

In ActiveReportsJS, report parameters can be used for a broad range of scenarios:

  • Selecting data to be displayed in the report output. The Get Started with Summary Reports walkthrough uses this approach.
  • Passing variables into a subreport or drill-through report. Visit the Get Started with Drill-Through Reports walkthrough for more information.
  • Allowing a report reader to alter the appearance of report items on the fly. For instance, you could conditionally hide a table column depending on a parameter value.

Adding a parameter

You can use the Data panel to add a new parameter into a report.

Expand to watch adding a parameter in action

A report parameter has the following properties.

  • The Name string is the parameter's Id. It is used to pass a parameter value from the main report into a subreport.
  • The Prompt string is the text that appears along with a parameter value editor in the Viewer parameters panel.
  • The Data Type is one of the following values that determines the domain of acceptable parameter values and the editor type that appears in the Parameters panel.
    • Boolean - a parameter value is True or False and a report reader sets it using the radio button.
    • DateTime - a parameter value is Date and Time and a report reader selects it from a calendar control.
    • Date - a parameter value is Date and a report reader selects it from a calendar control without the time setter.
    • Integer - a parameter value is an integer number, and a report reader types it in a text box.
    • Float - a parameter value is a decimal number, and a report reader types it in a text box.
    • String - a parameter value is a text, and a report reader types it in a text box.
  • The Multivalue flag indicates whether a parameter may have more than one value. This option applies only if the parameter has the Available Values specified. The value editor for multivalue parameters includes the Select All option whose label can be set in the Select All Value property of a parameter.
  • The Hidden flag indicates whether a parameter should be displayed in the parameter panel. Hidden parameters are used to pass data between a main report and subreport.
  • The Allow Null Value flag indicates if a parameter's value can be undefined. The Null checkbox is shown alongside the value editor in the parameters panel.
  • The Multiline flag appears if the Data Type is String and indicates whether the value editor should allow multiline input.
  • The Allow Blank Value flag appears if the Data Type is String and indicates whether a report reader could leave the parameter's value empty.
  • The Available Values collection limits the range of acceptable parameter values and shows the drop-down editor in the parameters panel. Each available value has the Label and the Value. The former is displayed in the parameters panel. The latter is used for report processing. The list of available values could be automatically pulled from a DataSet or typed manually using the From Query and Non-Queried options, respectively. The Get Started with Summary Reports walkthrough uses the feature to display the list of sales channels from a data set.
  • The Default Value configuration indicates the value that a report should be initially run with. The default value could be pulled from a data set if you select its name and the field name using the From Query option. You could also provide the default value manually using the Non-queried option.

Cascading Parameters

Cascading parameters is a configuration where one parameter depends on the value chosen in another parameter. For example, the Get Started with Fixed Layout Reports walkthrough uses this feature to show the order list for the selected customers. The cascading parameters configuration involves the following parts.

  • A DataSet whose configuration depends on the first parameter's value. For instance, the Fixed Layout Report walkthrough uses the data set that filters the data with the parametrized OData filter query.
  • The second parameter that pulls available values from the data set. When the first parameter's value changes, the data set updates and refreshes the available value of the second parameter.

Expand to watch using cascading parameters in action