Smart Data Grouping in Foxfire! 6.01

By Andrew MacNeill, March 11, 2002

The latest version of Foxfire! includes a "Data grouping" feature that can help make large data dictionaries more accessible for end-users. This feature works by using a pre-defined "grouping" field in the Data Items table and uses it to create "groups" of data. This feature is controlled by the variable pf_groupfld and may be set in the Preference Setup phase of the FFCONFIG file. By default, this variable is set to "rpt_ditem.rdi_misc", using the Miscellaneous field of the data items but you can make it as complex as you want, including using UDFs. If you don't want to use this feature at all, just set the variable to blank, and the feature will be hidden from end users.

Smart Data Grouping is one of the new features found in Foxfire! 6.01. It only affects users when they are selecting data in the Data Item selection dialog. When they attempt to remove data items or choose sorting items, the grouping automatically switches to All data items, making it easier to remove other data items.

Let's take the Cars sample database as an example. A developer might decide to group items based on the Table name or Alias of each data item. In this case, add the following line into the Preference Setup phase of FFCONFIG.PRG:

pf_groupfld = "rpt_ditem.rdi_alias1"

Now when a user creates a new request and clicks on Data Items to select the content for the report, Foxfire! creates a drop-down that lets them select the different aliases to find the desired data items faster (as seen below).

Using Alias1 might be obvious for developers, but it doesn't mean an awful lot to end-users. What does "PURCH_FROM" mean? The other drawback to using ALIAS1 is that it doesn't deal with some of the potential intricracies of the data. If you use a Lookup table to hold descriptions, the look up table will use its OWN Alias instead of the table that looks up data. As a result, developers might want to look at other fields in the Data Dictionary to highlight the information.

A great field for this is the User-defineable Group Ids. If you aren't using them for other purposes, try putting in friendly grouping terms and using it for the value of pf_groupfld.

pf_groupfld = "rpt_ditem.rdi_misc"

In the example below, I have put friendlier terms into the User-defineable field. I included "Gross Profit" with the Inventory listing. Now when the user selects Inventory listing, they see all data items related to their inventory (as opposed to just the ones that use the CARS table).


Advanced Installations

If you are using Foxfire! with filters in your preference set, you might already be using the RDI_MISC field for another purpose. Using RDI_MISC is an example but you can create fairly complicated settings as well. Here's an example:

One developer uses RDI_MISC to store groupings of data. The values in RDI_MISC are terms used to define the module where the data comes from. For example, allowed values are AP, GL and AR. There are several preference sets that have Data Item Filters set to

RDI_MISC = "AP" or RDI_MISC= "AR"

The developer still wants to use RDI_MISC field for preference filters but also data grouping. The solution is to identify the data grouping settings with some form of key combination.

AP-Vendors
AP-Accounts

In the above case, the developer changes the pf_groupfld to be:

m.pf_groupfld = "IIF('-'$rpt_ditem.rdi_misc,PADR(SUBSTR(rpt_ditem.rdi_misc,ATC('-',rpt_ditem.rdi_misc)+1),30),SPACE(30))"

The logic here states that if there is a hyphen ("-") in the Rdi_Misc field, it will take the text after the hypen, otherwise it will put it with all of the items.

The end result is that the Preference Set Filters still work but also provide easy to use Data Groups for the users to find the data they want.

The only thing the developer needs to be aware of is that if the syntax of their preference filter. The above example would mean that Preference filters that used INLIST or $ would not necessarily work. If this was the case, another field could be used.

An Interesting Idea

If you are reading this and think what you really need is another field in the Data Items table, add one in! Foxfire! is designed so you can add fields to any of the tables without causing any problems to the system. So add a new field and make use of it with your Data Grouping filters.

One of Many New Features

Smart Data Grouping is just one of the great new features in Foxfire! 6.01 designed to make Foxfire! easier to use for end-users, as well as developers. This idea came directly from other developers, who use Foxfire! in larger applications. If you have ideas as how to make Foxfire! better, drop us a line at support@micromegasystems.com and let us know how we can make Foxfire! better so you can run with it.