baan999
25th May 2011, 17:17
I am selecting tppdm600.stdt and wants year and month to printed on my report

e.g tppdm600.stdt (01-03-2011)

(01 is date and 03 is month and 2011 is year)

i want to dispaly/print in MONTH COLUM = MARCH AND YEAR COLUM = 2011

what should define in the session and report -

Hitesh Shah
25th May 2011, 17:27
Use spriintf$ function to print month and year based on a date value .

ysovva
30th May 2011, 13:17
dte format

The
num.to.date( long dayno, ref long yearno, ref long monthno, ref long month_dayno )

will give you all you need, as well as

%H name of month (‘January’ - ‘December’) in sprintf$ function:
result = sprintf$("Date: %D(%02d %-20H %04Y)", date.num())
| result contains "Date: 12 June 1993"

so, you can use it like:
month.col = sprintf$("%D(%H)", tppdm600.stdt)
year.col = sprintf$("%D(%04Y)", tppdm600.stdt)

From num.to.date by using domain ttaad.monm you can convert the monthno by ltoe(monthno) to month description


UTC format

utc.to.date( long utc, ref long yearno, ref long monthno,
ref long month_dayno, ref long hours, ref long minutes,
ref long seconds )

month.col = sprintf$("%u(%H)", tppdm600.stdt)
year.col = sprintf$("%u(%04Y)", tppdm600.stdt)

You can define the month.col and year.col in the report script and make the reassigning there

baan999
31st May 2011, 21:39
Thanks to all..

I want to print
e.g. Jan Feb Mar Apr May Jun ..... (header) and below to that Value
xxx xxx xxx xxx xxx xxxxx
How and what to define in session/report...

mark_h
31st May 2011, 22:09
Depending on what you really want to do on how simple or hard this can be. TO get the 3 character name output.date.str = sprintf("%D(%h)", input.date). Now how to get that into rows is the questions. The one time I did something like that I was tracking hours per month(something like that) and just used arrays. So I made the labels strings and the report looked something like this

month(1) month(2)........................month(12)
hours(1) hours(2).........................hours(12)

Different ways to do this, but I thought simple arrays were okay. In the above report the variables month(1) would have Jan, month(2) would have feb, etc. I also allowed the user to pick the starting month. So they could pick June and the report would run from jun 11 to jun 12. Basically as I got each of the planned hours records, looked at the month and determine which array element to update.

This was the basics and should get you started.