This posting shows how to add option fields to a report’s request page.
I developed a simple report on base of table Sales Header.
To filter by field Posting Date you can simply add that field to report data item “Sales Header”‘s property ReqFilterFields, but in this sample we check out how to handle complex filter processing.
Add 2 global variables of type Date: StartDate, EndDate.
Now edit the request page (Menu View/Request Page), add a container line, a group line and 2 field lines to the request page, set the SourceExpr in line 1 to StartDate, line 2 to EndDate.
To apply the filter fields add following code to trigger Sales Header – OnPreDataItem.
If both filter fields are filled, the data is filtered: StartDate<=Posting Date<=End Date.
if only StartDate has a value: StartDate<=Posting Date
if only EndDate has a value: Posting Date<=EndDate
When running the report, we get: