Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
umartareen
Creator II
Creator II

Creating Qvd With The Latest Reload Time as its Name

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

1 Solution

Accepted Solutions
maxgro
MVP
MVP

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;

View solution in original post

4 Replies
marcus_sommer

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

umartareen
Creator II
Creator II
Author

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.

maxgro
MVP
MVP

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;

umartareen
Creator II
Creator II
Author

Great, thank you !