Skip to content

04 Parameters default

Sometimes it's necessary to assign default values to parameters. This can be accomplished using the srssetup command, by matching columns with the corresponding variables, such as [[datefrom]].

XML
<srs title="Parameters defaults">
  <def>
    <itm model="param" name="task_created_at_from" type="date">[[datefrom]]</itm>
    <itm model="param" name="task_created_at_to" type="date">[[dateto]]</itm>

    <itm model="command" name="srssetup" type="server"><![CDATA[
  select 
    convert(varchar, DATEADD(day, -360, GETDATE()), 23) datefrom, -- last year
    convert(varchar, EOMONTH(getdate()), 23) dateto --end of month
    ]]></itm>
  </def>
</srs>