This tutorial describes the steps required to create a report with parameters. In this example, we will create two parameters of Date Timetype, delimiting the time period for the report.
To create the parameterized report, follow the steps below.
-
Bind the report to a data sourceand drop the required fields from the Field Listonto the report's Detail band.
-
In the Field List window, right-click over the Parameterssection, and in the invoked menu, click Add Parameter.
Repeat this action to create the second parameter.
-
In the Field List, select the first parameter, and in the Property Grid, set its (Name)to FromDate, Descriptionto From:and Parameter Typeto Date Time.
For the second parameter, set these properties as shown in the following image.
-
Select the report(by clicking anywhere over the blank space surrounding the bands' area), and in the Property Grid, locate the Filter Stringproperty and click its ellipsis button. The FilterString Editorwill appear.
In this dialog, define the required expressions involving the created parameters.
Note Make sure that the report's Request Parametersproperty is set to Yes, as it is by default. Otherwise, the parameters won't be requested during the preview, and as a result, you'll get a blank report.
-
Finally, drop the required data fields from the Field List onto the report bands, to create the report's layout.
The parameterized report is now ready. Switch to the Preview Tab, and in the Parameterssection, define the required values and click Submit.