Tips & Tricks

Parametrisation of report prompt default values

1 minute read

IntelliPen document production allows report prompts to be given default values.

These may be hard-coded values such as “05/04/2013” or they may be session variables provided by the IntelliPen system such as “?PayrollID”, “?SchemeMemberID” etc (for a full list of these, see the article on session variables).

Additionally, VBScript may be used to provide calculated values.  Any VBScript functions may be used and an inbuilt IIF function is also provided to allow conditional statements to be stored.  Therefore to calculate the current tax year date the following statement could be used:

IIF(Month(Date()) < 4 AND Day(Date()) < 6, DateSerial(Year(Date())-1,05,04), DateSerial(Year(Date()),05,04))

When put into a default value, this must be escaped to be valid XML meaning the < or > characters must be converted to their escaped versions &lt; and &gt;

This gives the prompt as:

<Prompt mandatory=”no” name=”EffectiveDate” label=”Effective Date” datatype=”date” defaultvalue=”IIF(Month(Date()) &lt; 4 AND Day(Date()) &lt; 6, DateSerial(Year(Date())-1,05,04), DateSerial(Year(Date()),05,04))”/>