Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set Seconds Off for a report
Message
De
23/02/2024 23:36:53
 
 
À
23/02/2024 17:53:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
01687644
Message ID:
01687645
Vues:
62
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform