SuperTemplate v4.1f Browse Modifications

The Story...

Recently Mike Hanson released v4.1f of his SuperTemplates, one of
his modifications in this version was "SubLists" in the Browse
Template.  This addition was just what I needed for a current
project... but upon application, it came up just short of all the
functionality I desired.  That's what lead to the creation of these
modifications.

The modifications are to three template files (*.TPS), including
Browse.TPS, BrwsGrps.TPS and SubList.TPS.  The first two require
minor modifications, only a couple of lines, the other template
requires several lines of code added.


What the modifications do...

I've added these items to the Browse template.
     Reverse SubList(s)
          Allows for reversing the display order of a sublist, up
          to two sublists may be reversed.

     Filter the SubList(s) (Using FORMULA)
          Filter out records on the SubList.  The example allows
          for the displaying of invoices only greater then $xx.xx
          amount.

     Totals on SubList(s) (Using FORMULA)
          Total a SubList value for records displayed in SubList.
          The example shows totals on quantity and amounts.

     Calculations on SubList(s) (Using FORMULA)
          Performs calculations within the SubList.  The example
          shows extended price on Quantity * Price.


User Beware...

I don't claim to be an expert in Clarion, SuperTemplates or
anything else for that matter.  Feel free to use these
modifications at your own risk and pass along to others.  REMEMBER
to make a backup copy of your template files before making
modifications.


How to make the modifications...

I've enclosed three files Browse.Txt, BrwsGrps.Txt and SubList.Txt,
these files clearly show what changes to make to each of their
respective templates.

Browse.TPS


1.   Change the last #PROMPT statement for clarity.

2.   Add two new #PROMPT statements.


BrwsGrps.TPS

1.   At line 1422. Add #ELSIF statement.


SubList.TPS

1.   At line 136.  Replace "Fill_%SubList ROUTINE" with
     "Fill_%SubList ROUTINE" in the SubList.Txt file.


How to use the modifications...

The included example provides good example of how to use all the
modifications, review it and how it works.

Reverse SubList(s)
     To display a SubList in reverse order, at the Reverse Sublist
     field on the Procedure Properties Screen enter or select the
     filename of the file used by that SubList.  Up to two SubLists
     may be displayed in reverse order.

Filter the SubList
     Create a data field, it can be of anything, as it doesn't get
     used in the end.  I like to use LOC:DUMMY BYTE. Create a
     Conditional Field Formula using the Formula Class of "SLF:" +
     the filename of the file used for that SubList.  In the
     example the class would be "SLF:Invoice".  Enter your filter
     in the If Condition area.  In the example the filter is
     "Inv:Total > LOC:Amount".  LOC:Amount is a value you enter on
     the browse screen itself.... could be a global variable, or
     receive it's value from somewhere else in your application, or
     you could hard code in the filter, ie "Inv:Total > 50".

Totals on SubList
     Create a Computed Field Formula using the Formula Class of
     "SLT:" + the filename of the file used for that SubList.  If
     having multiple totals on a single SubList add an incrementing
     number to the end of the Formula Class.  In the example the
     Formula Class is "SLT:Invoice1".  As many SubList totals as
     you wish maybe used.  In the Formula area enter the field you
     want to total.

Calculations on SubList
     Create a Computed Field Formula using the Formula Class of
     "SLC:" + the filename of the file used for that SubList.  If
     having multiple totals on a single SubList add an incrementing
     number to the end of the Formula Class.  In the example the
     Formula Class is "SLC:InvItem1".  As many SubList calculations
     as you wish maybe used.  In the Formula area enter the
     calculation you want to perform for each record displayed.


If you have an Questions....

Contact me on DBA Solutions BBS or Compuserve 71371,2266

Lee Ryan
Topeka, KS
