Adding a parameter in the query builder

Top  Download  Previous  Next

The parameter is the department the ticket concerns.

1.Create a list of departments:

1.In the side pane, add a new dataset and click on Add query.

1.Start the query builder.

1.Drag the reports.departments table to the main part of the builder.

1.Select the id and name columns.

1.Click on [ OK ], and then on [ Finish ].

en_rep_designer-parameter_dataset-add-query_01_zoom16

en_rep_designer-parameter_query-builder-departments_01_zoom16

2.Add a report parameter:

2.In the side pane, in the Parameters section, click on +.

2.Fill in the form:

•Name – the name used in the query

•Description – the description visible in the report

•Type – Number (32 bit integer)

•Allow null value – selected

•Value – empty (delete the value)

•Value source – dynamic list

•Data source – the available source

•Data member – report_departments

•Value member – id

•Display member – name

2.Confirm the form.

en_rep_designer-parameter_parameter-add_01_zoom16

en_rep_designer-parameter_parameter-form_01_zoom18

3.Open the tab with the report preview. The report now requires you to select a department before it is generated.

en_rep_designer-parameter_parameter-required-preview_01_zoom16

4.Link the parameter to the query:

4.Return to the report design.

4.In the side pane, select editing of the first query.

4.Start the query builder.

4.In the side pane, open Query properties.

4.Click on the ellipsis in the filter field.

4.Add the condition department_id = ?department_id.

4.Confirm the filter and the query to return to the Data Source Wizard window.

en_rep_designer-parameter_query-edit_01_zoom16

en_rep_designer-parameter_filter-condition_01_zoom16

en_rep_designer-parameter_filter-condition_02_zoom16

en_rep_designer-parameter_filter-condition_03_zoom16

5.Set the query parameter:

5.In the Data Source Wizard window, click on [ Next ].

5.Expand the department_id parameter.

5.Change the parameter type to Expression.

5.Set the result type to Number (32 bit integer).

5.Delete the value 0.

5.Click on the ellipsis and double-click on the name of the report parameter.

5.Confirm the selection and finish.

en_rep_designer-parameter_query-parameter-expression_01_zoom17

en_rep_designer-parameter_query-parameter-confirm_01_zoom16

6.Save the report (Ctrl+S).

Next: Report with a custom SQL query.