The sample project Chapter14_Parameters.pnj contains a report called Report1 that includes two parameters: UserName and CategoryID. You can locate this sample in the \userguide\samples folder under the PEERNET Reports installation directory.

 

parameter_user_name parameter_category_id

 

In this report, the UserName parameter is attached to Text Field 2, which contains the words User Name as the sample value:

 

parameter_user_name_properties_1 parameter_user_name_properties_2

 

As well, the CategoryID parameter is referenced in the Criteria field of the CategoryID column in this report’s Record Source View:

 

parameter_category_id_record_source_properties

 

When you select the Print Preview command, the Parameters dialog box is displayed before the report is previewed. At this time, you can type values for your parameters into the dialog box:

 

print_preview_parameters_dialog

 

In this example, we have typed Jane Smith as the value for the UserName parameter, and 1 as the value for the CategoryID parameter.

 

After you have typed the desired parameter values, click OK to preview the report. The bottom of the first page of the previewed sample report is shown below:

 

 

parameter_report_print_preview

 

 

The value you typed for UserName (in the example, Jane Smith) appears in place of the word User Name in Text Field 2 in the footer of each page of the report.

 

As well, only those records where CategoryID equals 1 are displayed on the report.