spartacus
11th December 2001, 10:33
I programmed in a reports after field section a "need()" function call. I retrieved the argument for need from tttxt002.nlin (The number of lines, which the current text needs). I tried also with a fixed number as argument, but that doesn't help. The report crashes sometimes with the message :"Function need; Recursion not possible refcount=2; Can not continue in <reportnp> in DLL: ottstprepdll(get.company).."
Is it possible, that this is a problem of the report DLL?
Thanx
Spartacus
Han Brinkman
11th December 2001, 16:38
Could it be that it crashes because you have texts with more than 60 lines, meaning that it will never fit on one page?
Regards,
Han
spartacus
11th December 2001, 18:30
I think this cannot be the reason. I think I have a maximum about 12 lines
mark_h
12th December 2001, 16:39
I have never used the need function, but I see from your post that you are checking it in an 'after field' section. Is it in the after.print or before.print section? From a quick glance at my knowledge quest CD it mentioned that you would use this function in the before.print section on a text field. I am not sure if that makes a difference. Just a guess - I really thought Han had solved it.
Mark
spartacus
13th December 2001, 09:25
Hi Mark,
thanks for that hint, but I used it in a "before.print" - section.
Thanks
spartacus
Han Brinkman
13th December 2001, 10:28
Can you reproduce the error? If you can I would suggest that you debug the report script, I don't have a clue why it happens. For sure Baan doesn't support recursive calls so you have to find out by debugging what exactly is happening.
Rgrds,
Han
spartacus
13th December 2001, 21:07
Hi Han,
I can not debug, because at the moment I have no access to that system anymore.
Due to a lag of time I programmed the "need()" manually, with spool.pg.length and the actual line number. That works fine.
The report which is concerned is a cust of one of the tisfc0408m000 reports. In the program-script of this session the reporthandling is realized with brp.open, brp.close...... (IMHO a little complicated). Maybe the reason for the problem with
"need()" is related to that.
Greetings
spartacus
arunkw
13th August 2002, 08:28
Hi Spartacus,
I had encountered same Probelm of Recursion not possible for function say "need()" ref count = 2
I think that in Baan Resursion is restricted or not allowed [ i might be wrong to say that ]
but what i did to solve this proble is to have two functions calling each other
ie
| calling need.one() function from main body
need.one()
...
function need.one()
{
if condition then
need.two()
else
| Exit through the function
endif
}
function need.two()
{
if condition then
need.one()
else
| Exit through the function
endif
}
Thanks and Regards
Arun
jaapzwaan
13th August 2002, 12:39
Recursion in Baan is possible, as long as you don't use function arguments and local variables. So in the example above: it is not because you use two functions that makes it possible, it is because you don't have local variables and no function arguments.:cool:
pcolombo
30th July 2004, 03:21
Hi , Just Today i had the same problem. It occurs when you have a text field in a footer layout ( in despite you have text fields defined in details layout). you can discover where is the problem , running the report in debugger, entering "c" in the debugger session. Once the program stop pointing the line who caused the problem you can determine ( by the name of the function in generated script), who were the format/s where the text field is placed.
Hope this post can helps you and sorry about my english