shrikantc
20th February 2003, 07:34
I would like to print Days between Prod. Start date - System Date

In Baan Report, I want to print this without using Script

Please Help

Shrikant

RobertB
20th February 2003, 08:25
Hi,

Try this: long year.num, month.num, day.num, hours, mins, secs
long prod.start.date
long ret.val, prod.start.days, system.days


ret.val = utc.to.date(prod.start.date, year.num, month.num, day.num, hours, mins, secs)
prod.start.days = date.to.num(year.num, month.num, day.num)

ret.val = utc.to.date(utc.num(), year.num, month.num, day.num, hours, mins, secs)
system.days = date.to.num(year.num, month.num, day.num)

days.diff = system.days - prod.start.daysHTH

shrikantc
20th February 2003, 09:43
I dont want to use script
Because it hangs while edting.

Is there any way to do this without using script

Shrikant

Juergen
20th February 2003, 11:24
hi shrikantc,

normally very simple.
Please try this:

define a new report field in your report with

Print Expression : (date.num() - xxx)
Domain : tc mcs.long
...
...

where xxx must be replaced with your field "Prod. Start date".

Hope this helps,
Juergen

Paul P
20th February 2003, 12:56
Dear all,

Some, but not all, of the code that RobertB gave is absolutely necessary in BaanERP situation (but not on BaanIV or earlier). However, in BaanERP situation, variable system.days and line 6 and 7 can be deleted and line 8 modified to days.diff=date.num()-prod.start.days

Rgds,
Paul

shrikantc
20th February 2003, 13:00
Thanks ,

It should work but now I am facing diffrent problem, after adding this it is not showing any output and also any changes made to layout are not getting afftcted. i.e if I move fileds or change alignment it is saving and compiling properly.

Every time it is showing the old i.e. first generated report only.

Even if i Delete the detail line save the report and comple it is showing the same output.

Thanks once again for your imm. help. please help me in this matter also.

Shrikant

Paul P
20th February 2003, 13:04
Dear Shrikant,

Have you made sure that the report you're playing with is correctly attached to the session you want to play with ?

Rgds,
Paul

shrikantc
20th February 2003, 13:18
Juergen,

Thanks a lot ,

When I created new query and new report and insrted the print expression given by you.

Thanks once again.


Shrikant

RobertB
20th February 2003, 14:22
To Paul P:

...variable system.days and line 6 and 7 can be deleted and line 8 modified to days.diff=date.num...
How true!:D - I threw this code together in a hurry this morning, and couldn't test it, 'coz our Baan Server went down at the same time...

R