Sort fields getting the best of me...

Bastiaan Olij lists at
Mon Jan 4 16:37:00 EST 2010

Hey Sam,

Since I'm doing everything through notation I'm assuming for a moment
the 4GL command "Set report name" results in the report gettting
constructed and has a similar result to doing a $open on a report class.
I then change the sort fields in the $construct of my report which seems
to work the same.

The big question that remains is why the sort fields I've defined on my
report don't seem to get loaded properly when the report is being
constructed. Again I assume this is because my sort fields use the list
instance inside of the report which does not get defined until after
this stage has happened but that is only a guess.

Anyway, it is working at the moment and I'm satisfied the sorting I've
applied to the list is not overruled by the sort fields set for the report.



sam nicol wrote:
> bastiaan
> When you set the report name, it loads the sort table that you have assigned
> in the report layout.
> You can over ride this this by setting the list sort options after you issue
> the set report name
> So you 
> Set report name <xxxx>
> Clear sort fields
> Set sort field col1   with/out subtotal etc
> Set sort field col4   with/out subtotal etc
> Set sort field col1   with/out subtotal etc
> You do not need to issue a sort list at this point if your list is already
> sorted in the order that you want.
> It would seem to be this use in report subtotally that the set sort field
> has the option to specify things  like subtotal, new page. It doesn't make
> any much sense otherwise.
> Regards
> sam
> On 3/01/10 9:12 PM, "Bastiaan Olij" <lists at> wrote:
>> 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.
>> Cheers,
>> Bastiaan Olij
>> _____________________________________________________________
>> Manage your list subscriptions at
> _____________________________________________________________
> Manage your list subscriptions at

Kindest Regards,

Bastiaan Olij
e-mail/MSN: bastiaan at
Skype: Mux213

More information about the omnisdev-en mailing list