Linda Nemitz
3rd March 2006, 17:45
I am writing a Baan report and in my program scripts I have specific criteria which will determine if the selected record will be printed or not. At the end of the report, I want to show a section of totals of scrap, good pieces, and hours by part number and operation (this could be any number of operation/part number combinations). I thought of creating an array, but I am not sure how to create it for this multi-dimensional (oper, part, qty good, qty scrap, hours). Is this the best method, or is there a better way? As I read the detail and determine that a record is good, I want to see if the part/oper already exists in the array. If it does, just add to the totals for hours, scrap, good qty. If the operation/part does not exist, I want to add the operation/part with the totals for that oper, part to the array. At the end of my report, I then would read through this array and print the detail.

Any help would be greatly appreciated.

mark_h
3rd March 2006, 22:41
A couple of I can think to do this:

(1) Use two reports - one for the details and one for the totals. In the totals you could possibly sort on part/operation. Then after each part/operation print the totals(no details just part,operation and details). No real coding involved and you let the report do most of the work. Depending what you want you could have one spool file or two - depending how you open the information. I use this method on one or two sessions. The user thinks they see one report - but in reality they get two different reports.

(2) Use qss.sort/qss.search search the board for qss.sort and you will see some examples.