erdalmutlu
30th April 2008, 10:53
Hi all,

I am new in Baan programming and I am trying to use input fields in a report script, but when I debugged the program I found out that the fields are not the ones I intended to have.

Here is the report script:

declaration:
table ttftls014

extern domain tcqiv1 total

before.tftls020.vodt.1:
before.layout:
total = 0

select
tftls014.blnc
from
tftls014
where
tftls014.argt = :tftls015.argt and
tftls014.ccur = :tftls020.ccur and
tftls014.tlid = :tftls020.tlid and
tftls014.date = :tftls020.vodt
selectdo
total=total + tftls014.blnc
selectempty
message("Empty select")
endselect

Do I need to declare something?

Best regards.
Erdal Mutlu

cyprus
30th April 2008, 12:07
Hi,

I hope you are talking abt the input fields of the report.
If so, you do not have to declare them, you can just use them as it is ...


Cheers

en@frrom
30th April 2008, 12:52
Can you be a little bit more specific? What is your desired output? Did you define your report layouts with the required fields? Then you must also already have declared any necessary input fields...

erdalmutlu
30th April 2008, 14:14
Hi,

here is the read.main.table function from the program script:

function read.main.table()
{
select
tftls020.vono,
tftls020.vodt,
tftls020.ttyp,
tftls020.refr,
tftls020.dent,
tftls020.cent,
tftls020.amnt,
tftls015.argt,
tftls020.ccur,
tftls020.tlid
from
tftls020,
tftls015
where
tftls020.ttyp=tftls015.ttyp and
tftls015.argt=5 and
tftls020.ccur={:currency} and
tftls020.tlid="KKEB" and
tftls020.vodt between {:vodt.f} and {:vodt.t}
selectdo
rprt_send()
endselect
}


-----

All the fields in this select are seen through the right click -> Input fields of the report.
What I would like to achieve is whenever the tftls020.vodt is changed, run the SQL in
the report script, get the sum of tftls014.blnc (total in the report script) and print this on the report.
I testet the report script giving all the nessesery parameters
(
tftls014.argt = :tftls015.argt and
tftls014.ccur = :tftls020.ccur and
tftls014.tlid = :tftls020.tlid and
tftls014.date = :tftls020.vodt)

manually and it works.

Best regards.
Erdal Mutlu