Creating my first Servoy report and would like to put the Date/Time of the report in the header. I see how to use the tag %%pageNumber%% for the page number, however I cannot see how to place the current date or time.
Can someone point me in the right direction? Thanks!
There is no ‘standard’ tag for that so what I do is create a global value like ‘globals.datetime’. I then set the default value to ‘now’ in the dataprovider dialog/editor.
When you only need the date portion you simply attach a field to the global value and format the value with the format property as you wish.
When you want to use the time portion you again attach a field to the global value and again format that value but now for a time instead of a date. The only extra thing you have to do is, before calling the form, update the value like ‘globals.datetime = new Date();’.
Offcourse, if you need/want to work with tags you can do that by using %%globals.datetime%% but in this case you can not format the values and can not extract the time portion so you would have to make some sort of calculation making a string of the datetime or whatever creative method you would use.