When you define a parameter field, you allow your users to select from a set of values. If one value will be selected much more frequently than the others, such as standard shipping for an online retailer, then you can set that value as the default. Assigning default values to your report fields can save both you and your colleagues significant time entering your data.
- [Voiceover] When you define a parameter field, you allow your users to select from a set of values. If one value will be selected much more frequently than others, such as standard shipping for an online retailer, then you can set that value as the default for that field. In this movie, I will show you how to set a default value. My sample file is the Parameter Default report. And you can find it in the chapter 8 folder of your exercise files collection. My goal for this particular movie is to create a parameter field and then to assign it a default value.
To start, I need to create a parameter field, so I need to work in the Field Explorer, which appears on the right side of the program window. If you don't see the Field Explorer, then you can go to the View menu and click Field Explorer to display it. Once there, go down to the list of items and click Parameter Fields. And then, on the Field Explorer toolbar, click New. After you click New, the Create New Parameter dialogue box appears. First thing you need to do is type in a name for your parameter.
And I'll call this one Category. I type that in the Name box. My data type is String. In other words, it is text, but if it were another type of value such as a number, currency, I could select that. And I'm going to type in my list of values directly so that value is from a static list. If I wanted to draw from another list, I could click the List of Values down arrow and click Dynamic. But in this case, we are drawing from a static list that I define.
Now I can type in those values. I'll go to the value list and click the Click here to add item text. Then, I will type in the first item. My categories are furnishings, with a capital F. Return, then a down arrow. To highlight, click here to add item, then press enter. Next is housekeeping. Enter, down arrow, and enter. Then maintenance.
Enter, down arrow, and then enter. Office supplies. Two words, both with initial caps. Enter, down arrow, enter. And public areas, again, two words, both initial capped. And enter. Now that I've defined my values, I need to set the default, so I'll go down to the Value Options panel, and scroll down until I see Default Value which is here. I will click in the properties section to the right, and click the down arrow that appears, and I will select Public Areas as the default value, and click OK.
When I do, my parameter appears under parameter fields in the Field Explorer. Now I can use that parameter as part of a selection rule. I have created selection rules previously in this course, so I will go through the procedure fairly quickly. First, I need to open the Report menu, and then point to Select Expert, and then click Record. I need to identify the field that I'll be using as my base. That is Product Category and click okay. Now I can define my rule, and rather than having any value, which allows every value to appear, I'll click the comparison operator down arrow, and click is equal to.
Now I need to identify the field that contains the value that we're comparing to. So I will click the field selector down arrow to the right of the comparison rule. And the top field is Category. It's the parameter field I created. And I know it's a parameter field because it has curly brackets and a question mark around the name. So I will click my category parameter, and click OK. And you see when the Enter Values dialog box appears, the default value of Public Areas is entered automatically.
So I'll click OK. And I see those values appear in the report. Assigning default values to your report fields can save both you and your colleagues a significant time entering your data. If your business changes and you find that the default value is being selected less frequently, then you can either delete the default or change it to the more common choice.
- Setting program and report options
- Changing the page layout
- Linking to a data source
- Adding fields to a report
- Creating sections
- Sorting and grouping data
- Formatting number, dates, and other fields and objects
- Adding charts
- Selecting records
- Managing reports with parameter fields
- Summarizing data with formulas and cross-tabs
- Adding subreports
- Exporting reports