Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am looking to create Qvds with the last reload time as their name.
So every time I reload the application, a new Qvd is generated for the same table in the same folder but with new date and time without overriding the previous generated Qvd.
In short, I have to generate a new Qvd for every reload with reload date and time as their name.
Any ideas, please help,
Thanks and Regards
Umar
table:
load rowno() as id
AutoGenerate 100;
let vDateTime = date(now(), 'YYYYMMDD_hhmmss');
let vFileName = '$(vDateTime)_table.qvd';
if len(trim(FileSize('$(vFileName)')))>0 then
trace file exists;
ELSE
trace 'file doesnt exists, store';
trace $(vFileName);
store table into '$(vFileName)' (qvd);
ENDIF;
if len(trim(FileSize('$(vFileName)')))>0 then
trace file exists;
ELSE
trace 'file doesnt exists, store';
trace $(vFileName);
store table into '$(vFileName)' (qvd);
ENDIF;
Try something like this:
let vDateTime = now();
....
store table into table_$(vDateTime).qvd (qvd);
Maybe you need some additional formating for vDateTime to sort in a certain order and to avoid not allowed chars like ":" between hours and minutes.
- Marcus
Hi, thank you for the reply.
I tried this way, but the qvd that is generated has its name as Table_.qvd.
It is not recording the date and time. I tried the Now() function as you suggested and also ReloadTime().
I have even changed the set variables Dateformat, Timeformat and Timestampformats from (:) to (_), just in case the date and time do not appear.
table:
load rowno() as id
AutoGenerate 100;
let vDateTime = date(now(), 'YYYYMMDD_hhmmss');
let vFileName = '$(vDateTime)_table.qvd';
if len(trim(FileSize('$(vFileName)')))>0 then
trace file exists;
ELSE
trace 'file doesnt exists, store';
trace $(vFileName);
store table into '$(vFileName)' (qvd);
ENDIF;
if len(trim(FileSize('$(vFileName)')))>0 then
trace file exists;
ELSE
trace 'file doesnt exists, store';
trace $(vFileName);
store table into '$(vFileName)' (qvd);
ENDIF;
Great, thank you !