Parameters
The Report Designer allows you to use parameters to filter and otherwise manipulate the data to display in a report. You can prompt users for parameter values so that they control the contents of the report.
The example below shows a report that uses 2 parameters, in the Parameters Pane on the left of the preview window, to allow the user to define which Attribute will be summed, and how the data will be grouped. This report is available in the report Designer under Stardraw Reports | Summary Reports | Configurable Report.
Report Parameters
Report parameters are managed in the Data tab of the property inspector, on the right of the designer. The parameter settings control how and whether a user interface is presented to your users for each parameter. Parameter values are collected in the order they appear in the Parameters list.
You need to set the following properties to create a parameter:
- Enter a report parameter name. Each report parameter in the collection must have a unique name, and the name must match the name you enter or call in the Parameters page of the DataSet dialog.
- Set the data type, the text used to prompt the user, whether to allow null, blank, multiple values or multiline text, and whether to hide the user interface. For parameters with Date or DateTime data types, you have the choice to select the display format.
- Populate Available Values with a list of values from which users can choose, or set a default under Default Values.
The parameter settings are explained below.
Click on a section name below for more details on the settings it contains.
- GeneralGeneral
- Name: Set the name for the parameter in this field. The value you supply here appears in the parameters list.
- Data type: Set the data type for your parameter which must match the data type of the field that it filters. The interface presented might also differ depending on the data type.
- Boolean: Presents the user with two options True or False
- Date: Presents the user with a calendar picker to select a date if you do not supply a default value or a drop-down selection of available values
- DateTime: Presents the user with a calendar picker to select a date and a time picker to select the time in cases where you do not supply a default value or a drop-down selection of available values
- Integer: Presents the user with a text box or a drop-down selection of available values
- Float: Presents the user with a text box or a drop-down selection of available values
- String: Presents the user with a text box or a drop-down selection of available values
- Text for prompting users for a value: Enter the text you want to see on the user interface to request information from the user in this field. By default this is the same as the Name property.
- Allow null value: Select this check box if you want to allow null values to be passed for the parameter. It is not selected by default.
- Allow blank value: Select this check box if you want to allow blank values to be passed for the parameter. It is not selected by default.
- Multivalue: Select this check box to allow the user to select multiple items in the available values list.
For a multi-value parameter, you can also allow user to specify special value for 'Select all' option in the Value for 'Select All' property.
- Multiline: Select this check box to allow multiline values in the parameter. The control will automatically adjust to accommodate multiple lines.
- Hidden: Select this check box to hide the parameter interface from the user and instead provide a default value or pass in values from a subreport or drill-through link. Please note that if you hide the user interface and do not provide a default value, the report will not run.
- Display format: Choose a format for a Date or DateTime data type. The selected format is displayed in the Parameters pane of the Report Viewer. The Display format applies to parameters with available values specified by a query and the default parameter value.
- Available ValuesAvailable Values
These values are used to fill a drop-down list from which the end user can choose.
- Non-queried: You can supply Labels and Values by typing in static values or using expressions.
- From query: You can select a Dataset from which to select a Value field and Label field.
- Default ValuesDefault Values
This is the value that you give for the parameter if the user does not supply one, or if you hide the parameter user interface. You can choose from 'Non-queried' and 'From query' options.
Note: Under Available Values, the Value is what is passed to the query parameter, and the Label is what is shown to the user. For example, if the Value is an ID, you might want to supply a more user-friendly Label showing the name hat corresponds to the ID.
To add or edit a parameter
In the Data tab of the property inspector, expand the Parameters section and click Add to create a parameter, or click an existing parameter to edit it.
