Sort fields getting the best of me...

Bastiaan Olij lists at
Sun Jan 3 05:12:07 EST 2010

Hey all,

Hoping someone can shed some light on the subject here. I've got a list
with data that I fetched from my database and I'm trying to print the
contents of this list and use subtotalling. The list basically contains
records from three tables. Lets say for arguments sake these tables are
client, invoice, detail (they are not but its an easy example). Any
client can have 1 or more invoices, any invoice can have 1 or more
detail lines. All columns are dynamically added to the list and not
bound to anything in the CRB.

In my particular case I have a method within my report as follows
(ivDataList is an instance variable of my report and contains the data) :
For ivDataList.$line from 1 to ivDataList.$linecount step1
  do $cinst.$printrecord()
End For
I have not set the $mainlist property of the report (I haven't really
looked into this yet, it may be just what I'm overlooking).

My subtotal 1 sections will print some client info, my subtotal 2
section prints my invoice info and the record is my detail. The list is
already properly sorted and as I can have different client records with
the same name and since I'm sorting my invoice list on date I can't
garantee uniquness on that field I want to trigger my subtotalling on
the record ID of these records.

First question right there, seeing we are using sort fields to get this
to work, does that mean my data suddenly gets sorted on records IDs? So
far it seems to ignore this as far as sorting is concerned. If I add the
fields I am sorting on but without setting "subtotaling" to true, it
still seems to make these fields part of the subtotalling throwing
things off completely.

Second question, for some weird reason I can not get things to work
properly unless I set the sort fields in my report configuration and at
the same time using the old 4GL commands to set the sort fields.. It is
as if somehow it requires the configuration of the report to be set in
order to work, but it is not loading this into the sort fields buffer.
The only thing I can imagine is that everything is based on the contents
of a list and when the report gets constructed, this list has not been
assigned its contents yet.

I've got it working but I'm really starting to get a bit uncertain how
this stuff is supposed to work.

P.S. final bit that may be throwing things off, all the code and my
ivMainList variable is in a report base class while the specifics of
this report is in a subclass.


Bastiaan Olij

More information about the omnisdev-en mailing list