I. Overview
During data query, it is common to encounter data query corresponding to the specified days before and after a certain date, as shown in the following figure. How to achieve this?
II. Implementation idea
III. Example
1) Opening a template
2) Report parameter settings
Add a default value to the original Date parameter. The default value is a string and the value is 2008-01-30.
Add another parameter named day.
3) Parameter settings
Set the parameters screen to the following style:
Set the Date widget type to Date and return the default string type.
The widget type of parameter widget day is a drop-down box. Select the data dictionary from the property table on the upper right. The data dictionary is shown in the following figure:
4) Setting filter criteria
Delete the original filter criteria of A2.
Add the following two filter conditions to cell A2:
5) Saving a template
Click Pagination Preview, select a date, and then select the query range. The result looks like the image above.
For the completed template, see: %FR_HOME%\webroot\WEB-INF\reportlets\doc-EN\Parameter\Date_addition_and_subtraction.cpt