Save Report to File function and dynamically generating dated files

Is there a command I can add to my file name for the Save Report to File action type so that it dynamically adds the date to each file so I dont have to manually rename the files every day.

Try something like this:

[=Helper.GetUniqueString().substr(8,2)].[=Helper.GetUniqueString().substr(10,2)].[=Helper.GetUniqueString().substr(12,3)]

Gives time as HH.mm.xxx, like 13.20.450

Using [=Helper.GetUniqueString()] produces a date/time formatted like YYYYMMDDHHmmxxx such as 201407211649105. Using the .substr() function you can parse it out and add your own separators as I did with the first example for just the TIME portion.

For your filename, you could do something like:

C:\path\to\file\Report_[=Helper.GetUniqueString()].xps

So the filename should appear as:

Report_201407211649105.xps
3 Likes

That is a step in the right direction. Ideally I would want it formatted cleaner with just the date and time not the unique numbers at the end. I will toy with it and see if I can get it to come out how I want.

Figured it out. I wanted output of WP_07_21_2014.xps so i did “[=Helper.GetUniqueString().substr(4,2)][=Helper.GetUniqueString().substr(6,2)]_[=Helper.GetUniqueString().substr(0,4)].xps”

Thanks a ton.

4 Likes

I DONT UNDERSTAND ANYTHING. PLASE EXPLAIN WITH MORE DETAILS. SORRY. IM NEW IN THIS PROGRAM.

I PUT THIS COMMAND IN FILE NAME. c:\work report period\Report Date [=FD(’{DATE}’,‘dd-MM-yyyy’)].xps

BUT NO HAVE ACCTION. WHERE I PUT THIS COMMAND?[=Helper.GetUniqueString().substr(8,2)].[=Helper.GetUniqueString().substr(10,2)].[=Helper.GetUniqueString().substr(12,3)]

How i do that?? I put commands and dont know the correct steps!

Did you created Save Report to File action?