এই লেখাটি শুধু ইংরেজিতে পাওয়া যায়।
The video loads from YouTube when you press play.
A parameter is a question the report asks before it runs. Instead of building one report for every region, customer or month, you build one report and let the person running it choose. This guide adds a Region parameter and uses it to filter the rows. The video above shows every step.
What you need
- A report with data loaded, for example a CSV with Department, Employee, Amount, Region and SaleDate columns, and the table inserted (see Create a sales report from a CSV file).
Add the parameter
- Click an empty part of the page so the Report settings show on the right.
- Open Parameters and filter and click + Add parameter.
- Set the Name to
Region. The name is what you use in formulas. - Set the Question to Which region?. This is the text the viewer sees.
- Set the Type to Pick from a column, and choose the Region column. The viewer gets a list of the values in that column. The other types are text, number and date.
- Leave Start value empty so the report starts by showing everything.
Use it in the row filter
In the Row filter box, type:
ISBLANK(PARAM("Region")) OR [Region] = PARAM("Region")
This reads: if no region was chosen, keep every row; otherwise keep only the rows where Region equals the choice. When the formula is valid, Filter OK appears. The filter applies to the preview, the PDF, printing, the CSV export and the totals.
When does it ask?
- Preview: every time you click Preview, with your last answer filled in. Choose a value and click Run report.
- Parameters button: in the preview bar, it opens the question again so you can change the answer without leaving the preview. Clear empties the answer, which shows every row. Cancel keeps the earlier answer.
- Export PDF, Print and Export CSV: when you export from the Design view, the report asks first. Choose a value and click Continue. Cancel stops the export.
Tips
- You can use
PARAM("Region")in any formula, for example in a title text:CONCAT("Region: ", PARAM("Region")). - A parameter name starts with a letter and can contain letters, numbers, spaces and underscores. A report can have up to 12 parameters.
- Number and date parameters work well with comparisons, for example
[SaleDate] >= PARAM("From"). - Press F1 in Report Designer to open the built-in Help. The topic Parameters: ask a question before the report runs covers all of this.
Questions about your own reports? Send us a message and we will help.