Dynamic Export File Names

With dynamic file names, Report Commander can automatically generate part of the file name for your export file. For example, if you export the same report each day, you can have Report Commander automatically include the date as part of the file name. This way you can use the same command line to run the report each day, rather than having to name the file yourself each day.

To specify a dynamic file name, you include special formatting patterns as part of the export file name. Report Commander interprets anything within curly braces {} as a formatting pattern. For example, to include the current date, in yyyyMMdd format, you could use this value on the command line:

exportfile=c:\reportoutput\MyReport{yyyyMMdd}.pdf

If you run the report on December 3, 2004, the file will be created as

c:\reportoutput\MyReport20041203.pdf

These tables list the characters that have special meaning within a formatting pattern. Any character not listed is copied to the new name without modification. For example,

exportfile=c:\reportoutput\MyReport{yyyy-MM-dd}.pdf

would result in the file name

c:\reportoutput\MyReport2004-12-03.pdf

You can include as many formatting tokens as you wish, and each token can contain one or more formatting characters. For example, the following command line is equivalent to the one shown above:

exportfile=c:\reportoutput\MyReport{yyyy}-{MM}-{dd}.pdf

Formatting tokens can be included in the path in addition to the file name. For example, if you wanted to put the export files in a separate folder for each month, you could use

exportfile=c:\reportoutput\yyyy\MMMM\MyReport{yyyy-MM-dd}.pdf

This would create the following directory structure and file name:

c:\reportoutput\2004\December\MyReport2004-12-03.pdf

Note that Report Commander creates the directories for you as needed.

 

See Also

Formatting Patterns