Han Brinkman
13th August 2003, 22:48
We try to print the number op po's on a report with help of the aggregation function. However this brings up a error, it reports that the strip$ function is not allowed on a numeric field.

Am I doing something wrong?

Anyone having a clue about what I am doing wrong?

NPRao
13th August 2003, 22:55
Hans,

Refer to - strip$() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_string_operations_strip)

The strip$() function takes string as input file and you were passing long to it, hence the error.

you can change it to - strip$(str$(xxx)) to get away with that compilation error.

mgakhar
13th August 2003, 22:58
The Strip$() function is only used for String variables in order to strip off the trailing spaces. For eg. if a string var var1 is 36 chars long has a value "BAAN ", when u use strip$(var1) it outputs "BAAN", it strips off the trailing spaces.

Hope this helps.

Manish.

Han Brinkman
13th August 2003, 23:05
This is not what I meant, we added a field in the report, changed on the third tab the aggregate function. Compile, then the error is reported. So I didn't add the strip function myself, it's put in the script by the compiler.

I understand that you can't use a e.g. average function on a string field but a count should work.

mark_h
13th August 2003, 23:36
Hello Han!

One question - Did you change anything other than to select the aggregate function count? If that is all you did then I think you will need a new version of the report generator or maybe a new include file. It may even be the compiler, but I suspect something in the repgen program may be including the strip$ and the compiler does not like it. It maybe best to contact Baan, I am not really sure which piece may need to be updated.

Mark

tools123
14th August 2003, 03:00
Mark is right.undo the aggregate field and see if error goes away.
if it does not there is something else in the report.

Have you thought about a variable after each detail / after.po layout? I would assume your way of aggregating would count the
same PO many times if there are multiple positions on the detail.

rupertb
14th August 2003, 11:53
Han,
You've probably figured this out - anyway, the aggregate function count can only be used with fields of domain type 'numeric'.
Use another field in the report layout to count on.

Regards,
Rupert

mark_h
14th August 2003, 17:09
Yes - Rupert is correct and I did not think about that. When I read count of PO's I just assumed something line tdpur041.orno, which is long. I did a test of a count on a text string just to make sure I got the same error as Han - I did. So Rupert I believe has the correct solution.

Mark

Han Brinkman
14th August 2003, 19:56
To give you more background information: I am currently training some collegue's. They have basic SQL knowledge and it's hard to explain something that completly logic in 'normal' sql which doesn't work in Baan.

Of course we have solved it by using variables in the script.

Thanks a lot for your help, glad to hear that you guy's have the same problem. I thought I was going crazy after seeing the error.

Thanks again,
Han

Amit_Jain
14th May 2007, 10:41
Hi HAN / ALL

Actually this count function returns value in the variable that you select that is where the problem is?

You do one thing, you must have defined this field as sorting field now define a report input varible of type long namely count use this variable as 'form field'
in the 'After.field' layout which is defined for that particular field and see the difference

Do let me know if that solves your problem :)

Regards
Amit Jain