This topic is locked

Add Date to export file name

10/3/2008 1:59:24 PM
PHPRunner General questions
P
phpwalker author

Is there a way to append the current date to the export filename?
right now when i export, the name of the exported file is the name of the table (or the view). Is there a way to add the date to it?
for example:
current filename: champions_and_their_leads.csv
would like this to be: champions_and_their_leads_20081003.csv

P
phpwalker author 1/2/2009

Is there a way to append the current date to the export filename?

right now when i export, the name of the exported file is the name of the table (or the view). Is there a way to add the date to it?
for example:
current filename: champions_and_their_leads.csv
would like this to be: champions_and_their_leads_20081003.csv


UPDATE: for anyone else looking to add dates to export filenames... got the belo info from Sergey:
you'll need to modify export.php file for this purpose. You can either change it in the output folder (changes will be overwritten after the rebuild) or in C:\Program files\PHPRunner5.0\source\export.php file.
header("Content-Disposition: attachment;Filename=##@TABLE.strShortTableName##.xls");

needs to be replaced with

header("Content-Disposition: attachment;Filename=##@TABLE.strShortTableName##" . date('ymdhm', time()) . ".xls");
sidenote for those using Vista: I found that changing the export.php file in the program files was a bit of a hassle. had to rename the original to export_old.php, then was able to copy the revised export.php file into the directory as described above.
Hope this helps,
karen