Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set Seconds Off for a report
Message
 
 
To
23/02/2024 23:36:53
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01687644
Message ID:
01687648
Views:
38
>>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.

I know about the approach 1. And I will try your approach no 2. Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform