Date and time parameters

Pentaho Report Designer

Part Number

Perform the following steps to create a formula to display a calculated date in a report parameter:

  1. Open an existing report or create a new report and establish a data source and query, then drag your data-driven fields onto the canvas.
  2. Add a new parameter by clicking the Master Report Parameter button at the top of the Data pane.
    The Add Parameter dialog box will appear.
  3. Type in an appropriate parameter name and friendly name for the parameter.
  4. In the Value Type field, select or type in Date.
  5. Create a formula for the Default Value Formula.
    If you want the current date and time to be the default, you can use =NOW( as your formula, or for a slightly more specific output, try =DATEVALUE(DATE(YEAR(NOW());MONTH(NOW());DAY(NOW())-WEEKDAY(Now()))).
    Note: Alternatively, to define a time-related value use the Time Value Type and select the appropriate option under Timezone.
  6. In the Display Type field, select Date Picker, then click OK to create the parameter.
  7. Click Preview and verify that the parameter displays and functions correctly.
    You may have to adjust your query if it does not produce a testable result set.
Your report's date-based result set can now be manually adjusted.