Report parameters

Martin Obongita martin.obongita at yahoo.com
Fri Jan 14 11:50:30 UTC 2022


 Hi Kelly,
I have tried the steps you gave but still I don't have a solution.
I needed some clarification on:
1. Which parameter is passed on to pSortCol?
2. Why do we need an additional column in the list when we already have the column "code" to sort the list by?
3. Did you say I could put iDataList.sortCol into $sorts.1 at design time and set itssubtotal flag, Why iDataList.sortCol and not sortCol?
4. How would the report class look like in terms of the sections?
My report has the following sections:
1. Subtotal heading 12. Subtotal heading 23. Records4. Subtotal level 25. Subtotal level 1
Kind regards, Martin O.







    On Friday, January 14, 2022, 11:33:10 AM GMT+3, Kelly Burgess <kellyb at montana.com> wrote:  
 
 Hi Martin,

Maybe something like this in the report $construct -

Calculate iDataList as pDataList  ## use a copy of the list
If pSortCol='code'
    Do iDataList.$cols.$add('sortCol',kCharacter,kSimplechar)
    Do iDataList.$sendall($ref.sortCol.$assign($sendallref.code))
Else If pSortCol ='childCode'
    Do iDataList.$cols.$add('sortCol',kInteger,k32bitint)
    Do iDataList.$sendall($ref.sortCol.$assign($sendallref.childCode))
Else If pSortCol ='parentCode'
    Do iDataList.$cols.$add('sortCol',kInteger,k32bitint)
    Do iDataList.$sendall($ref.sortCol.$assign($sendallref.parentCode))
Else
    #
End If
Do iDataList.$sort($ref.sortCol,kFalse)  ## or do more specific sub-sorting per case after each $sendall

. . followed by your print loop . . .
For iDataList.$line from 1 to iDataList.$linecount
    Do $cinst.$printrecord()
End for
Do $cinst.$printtotals()
Do $cinst.$endprint()


Then you could put iDataList.sortCol into $sorts.1 at design time and set its subtotal flag.

You could also copy pSortCol (other parameters too) to an instance variable and use it to turn content on or off, when you want to do different things in subtotal sections depending on the sort type.

When I've built multi-behavior reports I've tended to add column(s) of non-printing metadata to the list for the report to use in $print method decisions, $nolineifempty field calculations, etc.

Kelly
_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
  


More information about the omnisdev-en mailing list