This parameter type is an aggregate type. That is, it creates several input objects in order to create the dates to be passed to the stored procedure. It allows the user to specify the range of dates that they are interested in using a number of different mechanisms:
By default, the date_range will be set to a specified period of 1 week before today, but a different default can be specified in the search definition. Although a fixed value for the dates can be specified (two values separated with a comma) this is not usually useful as the dates would be fixed and would have to be specified in internal format (milliseconds since 1 January 1970 00:00:00 UTC). Instead, the default state can be set by manipulating the attrs attribute of the parameter which controls the other input fields, for example, the selection of Specified Period or Predefined Period, and optionally an alternative time zone (see the Single date section above for details). The attrs attribute should contain up to six values separated with semicolons (;) or colons (:) as follows:
1=All Dates, 2=Today, 3=This Week, 4=Last Week, 5=This Month, 6=Last Month,
7=This Quarter, 8=Last Quarter, 9=This Year, 10=Last Year, 11=Custom
As an example, to set the default to be the Predefined Period 'Last Month', with the default Specified Period of 5 days the parameter would be:
<parameter name="dates" type="date_range" label="Dates:" attrs="2;5;1;6" argpos="1" />
As an alternative, a custom date can be specified using relative dates as indicated by a negative value for the 'from' date. The relative dates represent the number of days before today for example -1 represents yesterday. So to represent the day before yesterday, a Predefined Period of 'Custom with the value "‑2,‑1" could be specified like this:
<parameter name="dby" type="date_range" label="Dates:" attrs="2;1;2;11" value="‑2,‑1" argpos="1"/>
Note: If the attributes are set for a Predefined Period of 'Custom' and no value is specified, the search will default back to a Specified Period of 1 week.
Note: If you receive an error message containing ' Input string was not in a correct format' when running your search this indicates that either the value or attrs attributes are incorrectly formatted. The value attribute should be two numbers separated with a comma and the attrs attribute should be at least four numbers separated by semicolons or colons.
Copyright © 2014 CA.
All rights reserved.
|
|