Classic Usage
In addition to forcing the saving of data sets and naming them using the SetSavedDataFileName command, the template author can use the «SetSavedDataFolder()»
command to define where the data sets should be saved.
Here is an example:
«SetDataSaveFolder(Datasets\<AccountNumber>)»
If the DataSaveFolder set in this way is a relative folder, as with this example, then the folder configured into the Data Save Folder is prefixed in order to arrive at an absolute folder path. This example will use a Data folder which is at the same level as the template.
«SetDataSaveFolder(.\Datasets\<AccountNumber>)»
will use the Documents folder at one level below the template.
«SetDataSaveFolder(..\..\Datasets\<AccountNumber>)»
will arrive at a Datasets folder 2 levels above the template.
Note the <> characters around ‘AccountNumber’ – these indicate that XpressDox must extract the value of the ‘AccountNumber’ data element captured for the template, and insert that value into the folder name, giving a result, in this example, of ‘Datasets\A0001′ (assuming the ‘AccountNumber’ captured was ‘A0001′).
<WindowsLogonUser> is a system specified value and refers to the Windows logon name of this user. It can be included in the «SetDataSaveFolder()»
command. An example would be:
«SetDataSaveFolder(Datasets\<WindowsLogonUser>\<AccountNumber>)»
the result of which would be ‘Datasets\Melanie\A0001’.
The saving of data set can also be defined in the Configuration which would mean that the template author would not need to use this command on each template. Any Configuration settings which determine the file path of the data set would be overwritten by this command on the template.
Function-like Usage
As of version 5.3 of XpressDox, the command can be used as if it were a function, permitting function calls in its parameter list, for example:
«SetDataSaveFolder(concat('Datasets\',WindowsLogonUser(),'\',GetValidFileName(AccountNumber)))»