I. Overview
If there is a column of date-type data in the database, and you want to enter a certain date, the data of the current date can be queried, that is, the weekly report query, as shown in the figure below, how to achieve this?
II. Example
1) Opening the template
2) Parameter settings
Delete the original report parameter and add a new report parameter named Date. As follows:
Add the Date parameter to the parameter panel. The Date widget type is Date and the return type is the default string. The parameter settings are as follows:
3) Setting filter conditions
Delete the filter condition of the original A2 cell, and then set the filter condition for A2 cell again. Select the formula at the condition, as shown in the figure below:
The first formula:DateInWeek ($Date,1) returns the first day of the query week.
The second formula:$dateInWeek($Date,-1) returns the last day of the query week.
III. Save the preview
Save the template, click Pagination Preview, select a date and query only the data of the week of the date, as shown in the image above.
For details, see the template:%FR_HOME%\webroot\WEB-INF\reportlets\doc-EN\Parameter\Weekly_report.cpt