Creating Unique Report Names

You can use Java string formatting to create unique report names in the Output filename field.

This feature is particularly useful when you are running scheduled reports jobs, since it can generate a unique filename that quickly identifies the time and report name each time the job is run. However, Java string formatting can also be used on a one-time report job.

Enter the Java string specifiers and flags in the Output filename field to overwrite the default filename value. Separate specifiers with the underscore character (_).

Astoria uses these parameter values for this feature:
1
Current time (can include flag values for time details such as day, month, year, minutes and seconds of the minute from the time)
2
Name of the report.
3
Scope of the report.

Example: Insert a Timestamp Before Report Name and Scope

Enter the following string in the Output filename field:
%1$tm_%1$td_%1$ty_%1$tM_%1$tS_%2$s_%3$s
In this example string:
specifier Description
%1$tm Insert the current month.
%1$td Insert the current day.
%1$ty Insert the current year.
%1$tM Insert the number of minutes from the current time.
%1$tS Insert the number of seconds from the current time.
%2$s Substitute the text of the name of the scoped report.
%3$s Substitute the text of the scope of the report.

An example file name for a report using these specifiers might be 02_06_18_49_21_scopedTranslationJobs_Test Cabinet.html.

It is not necessary to include all of the specifiers if they are not needed to guarantee a unique filename. So if you are running the report weekly, you could include just the month, day, and year specifiers.

Example: Insert Seconds Since Epoch and Time Zone in an Explicit Filename

Enter the following string in the Output filename field:
Flexible_%1$ts_Formatting_%1tZ
In this example string:
specifier Description
Flexible Insert this explicit text string.
%1$ts Insert the number of seconds since the epoch (January 1 1970 00:00 GMT).
Formatting Insert this explicit text string.
%1tZ Insert the time zone abbreviation.

An example file name for a report using these specifiers might be Flexible_1517946894_Formatting_PST.pdf.

About Java String Formatting

For more information about Java string formatting, see https://dzone.com/articles/java-string-format-examples.