I. Overview
1. Problem description
The date widget wants to set a default value based on the current time, such as the beginning and end of the month.
2. Solutions
Use date class functions to achieve.
II. Example
1. Report design
Place two date widgets in the parameter panel, namely the start date and the end date.
2. Start date setting
Select the start date widget, select the formula underAttributes>Advanced>Widget Value, and enter the formula: DATEINMONTH(TODAY(),1) , which means the first day of the month, as shown in the figure:
3. End date setting
Select the end date widget, select the formula under Attributes>Advanced>Widget Value , and enter the formula: DATEINMONTH(TODAY(),-1) , which means the last day of the month, as shown in the figure:
4. Effect preview
III. Template download
Click to download the template: Date_widget_dynamic_default_value.cpt