Articles in this section

How to Enable Between and Other Operators for DateTime Parameters in the Bold Reports Embedded Designer

Published:
Updated:

Enable parameter operators in the Bold Reports® Report Designer to let users select conditions such as Equal, Greater Than, Less Than, or Between for DateTime parameters. This is useful when readers need to change a report’s date criteria or range at run time instead of requiring a separate report for each filter condition.

Applies to: Bold Reports JavaScript Report Designer embedded in an application. The enableParameterOperator setting is documented for the Report Designer; support in the Report Viewer is not covered here.

Step-by-Step Instructions

Step 1: Enable the Property in Client-Side Code

  1. Open the JavaScript file where the Report Designer is initialized.
  2. Locate the initialization settings for the control.
  3. Add enableParameterOperator and set it to true.
// Initialize the Bold Reports Designer with Parameter Operator enabled
$('#report-designer').boldReportDesigner({
    serviceUrl: "/api/ReportDesigner",
    enableParameterOperator: true
});

Property Details

Property Type Description
enableParameterOperator Boolean Enables or disables the option to enable operators in report parameters. Set it to true to show the operator option in the Report Designer.

Step 2: Configure a DateTime Parameter

The operator option applies to parameters with the DateTime data type.

  1. Open the report’s Parameters pane.
  2. Create a DateTime parameter or select an existing one and click Edit.
  3. Confirm that the parameter’s Data Type is DateTime.
  4. Select Enable Operator in the parameter properties.
  5. Save the report.

Step 3: Configure the Report to Use the Parameter

Enabling the operator controls the parameter prompt. To use a Between selection in a SQL Server dataset, create two query parameters and map each to one endpoint of the DateTime report parameter.

SELECT EmployeeID, OrderDate
FROM Orders
WHERE OrderDate >= @StartDate
  AND OrderDate <= @EndDate

In the dataset’s query-parameter mapping, add these entries:

Query parameter Value expression
@StartDate =Parameters!DateRange.Value(0)
@EndDate =Parameters!DateRange.Value(1)

Replace DateRange with the name of the DateTime report parameter. The Between selection supplies the start date at index 0 and end date at index 1. For a date-only SQL Server column where the end date should include the entire day, use an exclusive upper boundary instead:

WHERE OrderDate >= @StartDate
  AND OrderDate < DATEADD(day, 1, @EndDate)

For an Oracle dataset, use the Oracle parameter markers in the query:

WHERE OrderDate >= :StartDate
  AND OrderDate <= :EndDate

In the Oracle dataset’s query-parameter mapping, add these entries:

Query parameter Value expression
:StartDate =Parameters!DateRange.Value(0)
:EndDate =Parameters!DateRange.Value(1)

Replace DateRange with the name of the DateTime report parameter. For other providers, use the parameter marker required by that provider and map separate query parameters to =Parameters!DateRange.Value(0) and =Parameters!DateRange.Value(1). Alternatively, configure a dataset filter on the date field with the Between operator. The Report Server configuration steps in KB 21703 enable the same parameter prompt for Report Server; this article covers the embedded Report Designer and dataset mapping.

Step 4: Preview and Verify the Parameter Operators

  1. Preview the report.
  2. Locate the DateTime parameter in the parameter pane.
  3. Click the operator control next to the date input to view available options, such as Equal, Greater Than, Less Than, and Between.

The DateTime parameter UI showing the operator dropdown menu with options like Equal and Between

  1. Select an operator, such as Between, and choose the date range.
  2. Run the report and confirm the results match the selected condition and date range.

The parameter pane showing a date range selection using the Between operator

Download a sample application demonstrating this configuration here.

Related Articles

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied