Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set Seconds Off for a report
Message
From
23/02/2024 23:36:53
Al Doman (Online)
M3 Enterprises Inc.
North Vancouver, British Columbia, Canada
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01687644
Message ID:
01687645
Views:
61
>Hi,
>
>I have a report which shows the date and the time when the report is printed (on the top of the report). I use the following expression:
>
>TTOC( DATETIME() )
>
>This prints the date and time exactly as I want to. Except it also prints the seconds. I prefer to print only hours and minutes and PM/AM.
>
>I know that I can Set Seconds Off.
>But, I am wondering, is it possible to Set Seconds Off somewhere in the Report (FRX file) and then restore the setting?

Some possible approaches:
1. Just before you run the report, SET SECONDS OFF. Then, just after running, SET SECONDS ON (or to whatever the value was before the report was run)
2. Create a UDF, something like MyTTOC(), and use that as your expression:
FUNCTION MyTTOC
LOCAL lcSetSeconds, lcRetVal

m.lcSetSeconds = SET( "SECONDS" )
SET SECONDS OFF
m.lcRetVal = TTOC( DATETIME() )
SET SECONDS ( m.lcSetSeconds )

RETURN m.lcRetVal
ENDFUNC
3. Look at report PEMs and put appropriate SET SECONDS calls at the beginning and end (maybe Report DataEnvironment?)
4. This is an ugly hack, but if useable PEMs aren't available you could put dummy non-printing fields at the report top and bottom and in the expression call a UDF to SET SECONDS for you

In the past I've favoured technique #2.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform