Chapter 4 - Selecting Records with Parameters
This chapter first shows you how to filter data using the Select Expert and then shows you how to create advance filters using parameters. Parameters are covered in great detail because they are also used within report formulas and for custom formatting. The effective use of parameters within record selection formulas and custom formatting lets you create dynamic reports that are tailored to each specific user.
Creating Parameters
The first part of this chapter showed how filtering data lets you customize a report to fit a specific user's needs. The only drawback to this approach is that you have to know in advance what that user's needs are when you are designing the report. And if different users have different needs, then you either have to save a separate copy of the report for each variation or the user needs to know how to customize the report themselves. Neither of these options is the most practical approach. A much better solution is to create a filter that uses parameters to prompt the user for their input prior to printing the report. This lets you create one report that satisfies many users.In their most basic form, report parameters are simply a means of asking the user questions about what they want printed. When the user opens the report he or she is prompted with each question and the answers are used to carry it out. Some examples of typical questions are, "What sales district do you want to report on?" and "What is the minimum sales amount you want to see?" Questions such as these let the user take a report that was designed to be used by multiple people and only view the data that he or she is interested in. The biggest benefit is that you don't need to save a separate copy of the report for each user. New parameter values can be entered each time the report is viewed. Figure 4-5 shows a parameter prompting the user for a report date and the print range.
Figure 4-5. Parameter prompt dialog box.
In this example the user is being prompted to enter two parameters. The first being an Order Date and the second is a date range. You can see a calendar displayed on the screen as well. Crystal Reports lets the user enter dates by typing them in directly or picking the date from this calendar control.
Tip |
---|
This dialog box is fully customizable. You can change the fonts and colors by modifying a single file. This is discussed at the end of the chapter in the Advanced Tutorials section. |
To read all my books online, click here for the Crystal Reports ebooks.