baanprog
4th September 2002, 18:29
Hi all,

I developed a customised report, its getting compiled but when i run it i get the following error:


"Error in reading sort file record, 6 fields scanned, 10 expected."

All 10 input fields are getting values.

The following areas iam doubtful about:

1. I have used in print expression fields like (tdpur046.amtb*tdpur046.qana).How can we use thigns like this.

2.Can we get total in after.fields , if in report script, i write expression like

tot.perc = total of (tdpur046.amtb)/total of (tdpur046.qana)

will baan take the total of fields in after field or just the value these fields have at the time the layout is printed, Iam using aggregate expression to find totals for the above field.

Please Help!! VERY URGENT

Thanks

mark_h
4th September 2002, 18:51
(1) Yes you can use tdpur046.amtb*tdpur046.qana as a print expression. But both fields must be input fields to the report.

(2) Several ways to handle after fields in scripts.
(a) Find the total..# field that is used to total a field. Then use this in the script. Ex:
perc = total..1 / total..2
I do not recommend this since every time you modify the report it may break this code.

(b) In the detail section sum the qty's yourself.
sometotal = sometotal + reportfield
sometotal1 = sometotal1 + anotherreportfield

Then in the after field section you could do the percentage.

(3) Also field defined in the script do not need to be added to the reports input fields.


Hope this helps

Mark

OmeLuuk
4th September 2002, 18:54
Update your software, portingset, solution 114812 in $BSE/include6.1, see also solution 117166...

Or tell what software you are on:
portingset
system dates in $BSE/include6.1
version of ttstprepdll (latest solution installed on that component, see bic_info6.1 -w ottstprepdll | grep From for compilation date
and we can give you more specific help.

Search the support site...

lbencic
4th September 2002, 18:54
The errors you are getting don't seem to be related to these 2 issues.

Make sure that the 2 fields you are using in the print expression are both input fields for the report.

The method you are using for gathering tot.perc is correct as well. Are you declaring tot.perc in the report script though? You can declare it as an input field for the report instead. They share declaration. (as I see Mark responded - don't declare in both). Maybe that's the problem.