Hot Topic (More than 10 Replies) Current date in body of reports (Read 1434 times)
etejeira
Junior Member
**
Offline


No personal text

Posts: 60
Joined: Aug 6th, 2005
Current date in body of reports
Aug 28th, 2005 at 2:37pm
Print Post Print Post  
I need to include the current date in the body (not in the name) of each report.
I know I can edit the resulting HTML file and place the current date whereever I want.
But is there a way of including it in the design of the report so that the current date appears in the first line of the body of the report?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Current date in body of reports
Reply #1 - Aug 28th, 2005 at 3:38pm
Print Post Print Post  
If you only want it to appear once at the top of the report, place an Unbound Value Box in the Report Header. Assuming it is named LE1, program it as follows:

LE1 = @Date

You can also use the program to show a more complex value:

LE1 = "Report As Of : " + @Str(@Date)

Or to format the date as needed.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
etejeira
Junior Member
**
Offline


No personal text

Posts: 60
Joined: Aug 6th, 2005
Re: Current date in body of reports
Reply #2 - Aug 28th, 2005 at 6:07pm
Print Post Print Post  
Thanks, it worked perfectly but it shows the date in the year/month/day format.
I want it in the day/month/year format.
How do I change it?
I have tried the Windows formats and the Sesame Property format with no results.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Current date in body of reports
Reply #3 - Aug 28th, 2005 at 6:21pm
Print Post Print Post  
Quote:
Thanks, it worked perfectly but it shows the date in the year/month/day format.
I want it in the day/month/year format.
How do I change it?
I have tried the Windows formats and the Sesame Property format with no results.


@Date will always return the date in the internal format of YYYY/MM/DD. If you want DD/MM/YYYY, format it in code. Something like this:

LE1 = @Str(@Dom(vValue)) + "/" + @Str(@Month(vValue)) + "/" + @Str(@Year(vValue))
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
etejeira
Junior Member
**
Offline


No personal text

Posts: 60
Joined: Aug 6th, 2005
Re: Current date in body of reports
Reply #4 - Aug 28th, 2005 at 7:03pm
Print Post Print Post  
Sorry but it does not work.
I changed Dom to Day and still did not work.
Should'nt there be a @Date somewhere in the script?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Current date in body of reports
Reply #5 - Aug 28th, 2005 at 7:06pm
Print Post Print Post  
I'm not sure precisely what you are trying to do, but, if you need to use @Date then:

LE1 = @Str(@Dom(@Date)) + "/" + @Str(@Month(@Date)) + "/" + @Str(@Year(@Date))
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
etejeira
Junior Member
**
Offline


No personal text

Posts: 60
Joined: Aug 6th, 2005
Re: Current date in body of reports
Reply #6 - Aug 28th, 2005 at 7:10pm
Print Post Print Post  
I do not need to use @Date.
I simply want the date in the format Day/Month/year.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Current date in body of reports
Reply #7 - Aug 28th, 2005 at 7:12pm
Print Post Print Post  
This will get you today's date:
LE1 = @Str(@Dom(@Date)) + "/" + @Str(@Month(@Date)) + "/" + @Str(@Year(@Date))

If you need some other date, let me know.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
etejeira
Junior Member
**
Offline


No personal text

Posts: 60
Joined: Aug 6th, 2005
Re: Current date in body of reports
Reply #8 - Aug 28th, 2005 at 8:37pm
Print Post Print Post  
Great!
That does exactly what I wanted.

Another more difficult question.
Is it possible to program Sesame to send an alert or an email when the date in a field reaches a particular value?
Or, if the date on a field is 22/9/2005, can it be programmed to send the alert on the 21st?.
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Current date in body of reports
Reply #9 - Aug 29th, 2005 at 2:10pm
Print Post Print Post  
Yes, that is possible, but you will need to have an external batch file actually control the timing of when Sesame runs. Write the SBasic program that actually does the date check and the email - probably use one of the variations on XLookup to check the date. Put the SBasic program in the application open event of an otherwise nearly empty application. Use the macro recorder to record and save a macro that exits Sesame.

Then use a batch file / shell script to start Sesame on a schedule (i.e.: once a minute, once an hour, etc...) Use the "-macro" startup flag to start the macro running. When started, Sesame will run the SBasic program that checks the date value and possibly send the email. Given sufficient "wait", the macro will then cause Sesame to exit. The batch file will then wait for the specified period and then do it again, ad infinitum.

In this way you can use Sesame as a "batch" processor that requires no human intervention.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: Current date in body of reports
Reply #10 - Aug 30th, 2005 at 4:33pm
Print Post Print Post  
I was able to include date in my reports as August 30, 2005 using the following code:

//FORMATS DATE AS Month Day, YYYY

LE0 = @Str(@Month$(@Date)) + " " + @Str(@Dom(@Date)) +  ", " + @Str(@Year(@Date))

Thanks for the continued tips,

Louis
  

Louis Galvao
Back to top
 
IP Logged