Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

report+date 1

Status
Not open for further replies.

yellowke

Programmer
Nov 5, 2002
48
BE
Hi everybody

I have a small problem.
I have a report that's based on a table.
In the report I show the date with the date() function and a text box.
The problem is that the date always appears on the report in American format. I want it in French format

What I have tried to do is to set in the regional settings (options) the date type to French. This didn't help.

I have the same problem with dates that come from the table on the report. In the table they all are e.g. 13/12/2003 andon the report they appear like 12/13/2003

It has something to do with the format. But I don't know how to fix this.

Anyone an idea?
Thanx
 
yellowke

In the init event of the dataenvironment of the report use SET DATE DMY or SET DATE FRENCH

The set date setting is scoped to the current datasession. If you set the date somewhere else, you have to reset it everywhere you need to. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi yellowke,

The best way to do the SETs respond to all forms is..

1. In your Main.Prg add a PROCEDURE..

PROCEDURE SetEnvironment
SET TALK OFF
SET CONFIRM ON
SET DATE FRENCH
SET DELETED ON
SET SAFETY OFF
** etc etc.. your standard SET commands
RETURN

Now in your basic Form class, in the Load event.. put the code..
DO setEnvironment

In all subsequent forms, if you use any code in LoadEnvironment, make sure, you have the code.. DO DEFAULT()

Also, the data environment follows its own SET codes. SO again in the BeforeOpenTables event.. you can add the code..
DO setEnvironment

This will take care of all the situation.

SO whenever you need a global modification to the SET commands, all you have to do is , change in the MAIN.PRG... PROCEDURE setEnvironment.

For your particular question.. SET DATE FRENCH or SET DATE BRITISH should set your need.
:)
ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top