February/March 1999: Volume 9 Number 1

PFXcrystal and Crystal Reports | Implementing context-sensitive help | PFX Software Protection | Powerflex news

Use Seagate Crystal Reports with PFXplus data files!

PFXcrystal is a brilliant product that opens up a whole new world of report generation to PFXplus developers. PFXcrystal provides a fast and seamless interface between the award-winning Seagate Crystal Reports and Powerflex data files including PFXplus Btrieve files and PFXplus compatible files.

It's simply a matter of installing the Powerflex driver for Crystal Reports, and you're off! There is no need to convert your PFXplus data files, or to install any ODBC drivers. PFXcrystal also comes with a PFXplus User Function Library.

PFXplus Data Files with Crystal Reports

Step by step guide to create a basic report using PFXplus version 4.30 sample data files.

Example 1

  1. Open a New (Standard) Report

  2. Select the Data Files

    In the Open Dialog, change the pattern to *.DAT. Change to the \PFX430 directory containing the sample data files that come as standard with PFXplus. Select the required files. The file selected for this example is MEMBER.DAT.

  3. Select the Required Fields

    Select the fields which are required for the report from the Fields tab. This can be done quickly by clicking the Add All button. The selected fields will automatically appear on the report when it is created. The fields may also be added and removed manually.

  4. Enter the Report Title

    Select the Style Tab to enter the Report Title "Members Listing".

  5. Preview the Report

    Click the Preview Report button which will produce the results in Figure 1.

    List of Members

    Figure 1: List of Members

It's that easy to create a basic report using Seagate Crystal Reports! The report output requires some basic formatting. Report customisation and basic formatting will be demonstrated in the following example, as will the use of formulas and special fields.

Example 2

  1. Open a New (Standard) Report

  2. Select the Data Files

    The files selected for this example are MEMBER.DAT and COUNTRY.DAT.

  3. Define Relationships Between the Files

    This is done in the Visual Linking Expert by linking common (indexed) fields between files. In this example MEMBER.COUNTRY is linked with COUNTRY.NAME.

  4. Select the Required Fields

    The fields selected for output are: SEX, NO, SURNAME, GIVEN_NAMES, DOB, RATINGS and WINNINGS from the MEMBER file and NAME and TIMEDIF from the COUNTRY file.

  5. Select the Fields by Which to Sort and Group

    The report may be sorted and grouped by a field or by a number of fields regardless of whether they are indexed. The fields selected to sort and group by are MEMBER.SEX and MEMBER.SURNAME. The report data will first be sorted and grouped by SEX, and within that group, it will be sorted and grouped by SURNAME.

  6. Select the Fields by Which to Total and Subtotal

    Total WINNINGS for females and males is required, so any numeric fields entered by Crystal Reports are removed by default except WINNINGS for the "grouping by SEX" tab.

  7. Enter the Report Title

    Select the Style tab and enter the Report Title "Sample Crystal Report".

  8. Preview the Report

    Although the data is sorted and grouped by SEX and then by SURNAME, the SURNAME grouping is not relevant for this report. SURNAME was selected for sorting purposes only. By right-clicking on the SURNAME Group Header and Footer sections under the Design tab, they are easily hidden by selecting Hide from the Shortcut menu.

    The results in Figure 2 are produced by performing the simple steps above.

    Sample Report

    Figure 2: Sample Crystal Report

  9. Format and Customize the Report

    To customize the report output:

    • Change the Report Style to Shading (in the Style tab of the Report Expert).

    • Remove the MEMBER.SEX field to minimize duplication with the Group heading.

    • Remove the Group Name from the Group Footer for added clarity.

    • Move the field headings into the Group Header to display them for each group.

    • Add a logo bitmap (in this case Powerflex Corporation).

    • Replace the Group Name field with a formula that prints "Female" and "Male" in full with the code:

      if GroupName ({Member.SEX}) ="M" then "Male" else
      if GroupName ({Member.SEX}) ="F" then "Female"

    • Insert a Summary field to display the average RATINGS for each group (select the RATINGS field first).

    • Insert a Grand Total field to display the average RATINGS for the entire report.

    • Modify the field fonts, alignment, date and number formats.

    The results shown in Figure 3 are produced.

    Customised Sample Report

    Figure 2: Customised Sample Report

Distribute Your Reports

This feature is only available in the Professional Edition of Crystal Reports. Once you have created your report and saved it, you can easily distribute it to your customers. The Report Distribution Expert will zip the report and all dependent files (including database files if desired), and create an installation disk or directory. Customers do not need to own Crystal Reports to run the report, but they will require a copy of PFXcrystal.

Prior to running the distributed report, customers can modify Group and Record Selection formulas, refresh the data, run the report to the Screen, Printer or to a Disk file, Exchange Folder, Lotus Notes Database or Microsoft Mail (MAPI), in the following formats: Excel, HTML, LOTUS 1-2-3, ODBC, Access Database, Text, Word and more. Reports can be set to print immediately or at a specified time.

This example demonstrates the minimal steps involved in creating a report. Crystal Reports also supports Report Analysis functions, Graphs, Queries, Formulas, Mailing Labels, Forms and much more.

Customers Create Reports

If you're a busy developer who doesn't have time for report designing, your customers can use Crystal Reports to create their own reports. You can design dictionaries to customise the appearance of a database, its tables, fields and data to make them more intuitive to the user, and to prevent the user from getting lost among database, table and field names. This is particularly useful where the database is complex and may contain hundreds or thousands of fields.

By creating a customised dictionary that contains a small amount of data specific to the work performed by a small group of users, you can provide those users with clear, easy access to all the data they need.

In addition, dictionaries can be used to impose data security as well as reduce support cost and time, increase user productivity, and reduce data misuse, loss, and damage.

PFXcrystal works with Seagate Crystal Reports version 6.0 and version 7.0.

PFXcrystal is available from Powerflex Corporation or your local dealer. You can also purchase Seagate Crystal Reports packaged with PFXcrystal through Powerflex Corporation.

The first person to notify us of a problem which causes this so far invincible product to crash will receive their single site single user driver for free!

Top of Page

Implementing Context-Sensitive Help

Christine Charalambous – Powerflex Corporation – Australia

One of the main issues to be addressed when using PFXplus to write a Windows-based application is how to provide the online help file for that application. This article describes the implementation of context-sensitive help for programs developed in the CCA environment.

Different HATs

For years, the overwhelmingly popular tool for creating online help for Windows applications has been Microsoft's own WinHelp system, which turns suitably structured RTF files into an online Help file.

In theory you can build the RTF source files from scratch, but it is such a laborious job that most developers use a Help Authoring Tool (HAT). Which HAT you choose will depend on cost and complexity. The top end of the market includes popular packages such as RoboHelp, HDK, Doc-to-Help and ForeHelp, and there are quite a few cheaper low-end alternatives as well.

For more information, you can search the Internet — one popular site you can visit is http://www.helpmaster.com/. The companies selling HATs are also happy to provide trial versions of their software via CD or download.

Whichever HAT you choose, one thing you should consider carefully is how well it can handle the creation of context-sensitive help.

Implementing Help

Once you have created your help file, there are a number of possible ways to introduce context help to your programs.

For non-CCA programs, the help file to be used by Windows can be specified by setting the predefined variable, HelpFile, in the program. For example

HelpFile = "pfxman.hlp"

Context help can be extended from forms right down to individual controls (CCA or non-CCA) by setting the helpid property in the object definition.

Where the helpid property has not been specified for an object, the helpid specified for its parent is used. Windows continues to filter up through the object hierarchy until a helpid is found.

If a helpid is not eventually found in a CCA environment, the Default Help Topic ID is used.

For CCA programs, there are two ways to set up context help. It can be defined at individual program level, or externally to the program with the use of a data file.

Help Defined at Program Level

For a CCA program, the help file is set by CCA_SetHelpFile before the object definitions.

CCA_SetHelpFile "pfxman.hlp"
// Object definitions
CCA_FormBegin pgPayment "Payments Entry"

A Default Help Topic ID (1) is set in CCA.PFI. Assuming that a Topic ID of 1 has been included in the help file, this will be used if no other helpid is found.

The Default Help Topic ID can be set to a different value in the program before CCA.PFI is loaded, as follows.

#use CCA

Setting context help for individual forms and subforms is implemented by passing an optional helpid argument to the CCA Form and Subform macros, as follows.

CCA_FormBegin pgPayment "Payment Entry" 0 0 70
CCA_FormSubformbegin 1 pgPayment 80
CCA_FormSubformMinor 2 pgCheck 0 10 83
CCA_FormSubformMinor 3 pgCredit 0 10
CCA_FormSubform 4 pgCash 0 10

For subform pgCredit the helpid has not been defined so Windows uses the helpid defined for its parent, pgPayment, which is 80. The helpid has not been specified for subform pgCash either, so the helpid specified for its parent, 70, is used.

As mentioned previously, the helpid can be directly specified for individual controls. For example, the helpid for a button object or an edit control can be set like this

wbutton oButton1{wndw=s1_OK, helpid=85}
wEdit oEdit1{wndw=RECEIPT#_,helpid=82}

Help Defined Externally

This method only applies to forms and subforms defined using the CCA macros.

At the end of the MBARUSER.INC file there is a function SETHELPFILETOPIC which is called where CCA_SetHelpFile has not been used. If CCA_SetHelpFile has been used it will override the use of SETHELPFILETOPIC to define the help file.

This SETHELPFILETOPIC function utilises a data file, designed for the purpose of defining the help file and Base Topic ID to be used on an individual program basis.

The SETHELPFILETOPIC function must be modified to include the name of the data file to be used. It will retrieve the help file and Base Topic ID from the data file.

FUNCTION SETHELPFILETOPIC string prgmname string basehelp returns integer
//Default Result Code.
helpfile = basehelp
result = 0
//Determine the HELPFILE & Base Topic ID
//based upon the program name passed in
open "ccahelp" as ccahelp
CCAHELP.PRGMNAME = uppercase(prgmname)
find eq CCAHELP by index.1
if Found begin

The data file definition looks something like this.

Data File Definition

The MENUBARS module needs to be recompiled using the following switches.

pfcn menubars /MS /DNO_MENUBARS /R

In using this system the helpid which has been set for forms and subforms is treated as an index which is added to the Base Topic ID for the program.

Changes still need to be made to the Object Definition to set the context help indexes for the forms and subforms.

CCA_FormBegin pgPayment "Payment Entry" 0 0 0
CCA_FormSubformbegin 1 pgPayment 10
wEdit oEdit1{wndw=RECEIPT#_,helpid=82}
CCA_FormSubformMinor 2 pgCheck 0 10 13
CCA_FormSubformMinor 3 pgCredit 0 10
CCA_FormSubform 4 pgCash 0 10

If the Base Topic ID is set to 70, then the Context Help ID for the Main Form will be 70, for Form pgPayment it will be 80, for Subform pgCheck 83, and so on.

For the edit control oEdit1, the specified helpid will not be treated as an index, and hence will not be added to the Base Topic ID. The Context Help ID will remain as 82.

Where a record that defines the help file for the program is not found, the CCA$_BaseHelpFile is used as the help file. CCA$_BaseHelpFile is set in CCA.PFI to "PFX.HLP" by default. It can be set to a different value in the program before loading CCA.PFI, like this:

#replace CCA$_BASEHELPFILE "pfxman.hlp"
#use CCA

Where there are no helpids defined in the program, the Default Topic ID will apply.

There will be more help on Help coming up in the next issue of POWERlines

Top of Page

PFX Software Protection

Have you ever wondered what happened to that single copy of your application you sold to an office which now has over 20 computers? Or why another customer, who always tells you how great your software is, hasn't called back to order the extra five copies they said they needed? And what about the company whom you know is using your software in interstate or overseas offices?

It's obvious - you need protection!

Protects Against Duplication

The PFX Software Protection program uses a powerful combination of registration and on-disk copy protection to protect your software from unauthorised duplication by your customers.

How Does it Work?

Once the end-user or developer has installed the software to the hard disk, the application will automatically run the PFX Software Protection Registration program. (See the image below for the Win32 Registration screen. This screen has been modified using the PFXplus Dialog Resource Editor, PFDRE, now available with PFXplus version 4.30).

Registration Screen for PFX Software Protection

The user enters their registered name, address and serial number. The program responds with a unique Installation Code for each computer system installed, along with a blank space for an Activation Code to be entered later.

The end-user phones or faxes this information through to a registration office. The details are then typed into a companion program used by the developer or marketer of the application to calculate the Activation Code.

The user then re-runs the PSP Registration program and enters the Activation Code. Once the code is entered and saved, the application becomes fully functional. The PSP Registration screen is not seen again until the application is moved or copied to another drive or computer system. Should this occur the registration program will automatically request a new Activation Code, starting the cycle over.

A unique aspect of this copy protection scheme is that the developer or marketer maintains total control over the number of copies of the software at a customer site. It upholds and protects site licencing policies with minimal effort. If the customer purchases a five copy site licence then five Activation Codes would be provided - it's as simple as that!

There are no special disks required for each system sold. In fact the registration program is a PFXplus program itself, which can be adapted by the developer to achieve an integrated appearance with the rest of their software package. The shell programs of both the end-user and companion registration programs are included with the PSP system.

Now Available

The PFX Software Protection program is very easily incorporated into existing programs and supports MSDOS and Windows 95/98 and NT environments.

Protect yourself - order your copy from Powerflex Corporation or your local dealer, before it's too late!

Top of Page

Powerflex News

PFX Developers Mailing List

Big news! Powerflex Corporation has set up a PFXplus Developers Mailing List. The PFXplus Developers Mailing List provides an e-mail forum where PFXplus developers can freely discuss any issues, problems or comments relating to PFXplus and other Powerflex products.

For those who are not familiar with mailing lists, here is a brief rundown of how ours works. To subscribe to the list, send a "subscribe pfx-dev-list" command to the list manager at listserv@pfxcorp.com">listserv@pfxcorp.com. You immediately become a member of the mailing list. To correspond with other members of the list, send an e-mail to pfx-dev-list@pfxcorp.com">pfx-dev-list@pfxcorp.com. From there, a copy of your e-mail will be sent to every member of the list. Similarly when another member sends an e-mail to pfx-dev-list@pfxcorp.com, a copy of their e-mail is sent to all members of the list including you. A number of other commands are also available, including "unsubscribe pfx-dev-list" which allows a member to remove themselves from the list at any time.

A set of easy instructions on how to use the mailing list will be automatically e-mailed to you when you subscribe.

Technical Forum

Our first Technical Forum for 1999 will be held on Thursday the 15th of April at 6.00pm at the Tower Hotel, corner of Camberwell Rd and Burwood Rd, Hawthorn. Everyone is welcome to come along and meet with the friendly team at Powerflex Corporation, have a few drinks and some nibblies, and discuss problems or share ideas.

Support for MS SQL Server 7.0

Powerflex Corporation is pleased to announce that the new version of PFXplus+SQL (Version 4.40) will support MS SQL Server 7.0. The benefits include support for full 255 fields and 16 indexes without needing to use amalgamated columns. As well as support for record sizes of 8K and better performance, with row locking rather than page locking by default. Contact Powerflex Corporation for further details.

PFXsort for Linux

PFXsort for Linux has recently been released by Powerflex Corporation, and is now available. Those wishing to order this product should contact Powerflex Corporation or their local dealer.

Current Versions of PFXplus Release Software

Powerflex Developer's Kit 16/32-bit 4.23
Powerflex Developer's Kit 32-bit 4.30
Powerflex Runtimes 4.30
Powerflex SCO 4.30
Powerflex LINUX 4.30
Powerflex RS/6000 4.11
Powerflex HP 9000, Motorola 4.11
Powerflex Siemens, DEC 4.11
Powerflex Toolbox Source Code 2.63
PFX C-lib MSDOS 4.20
PFX C-lib Xenix/Unix 3.21
PFX C-lib for Windows 4.33
PFXsort for DOS, DOS-386, Win32 4.30
PFXbrowse 32-bit with Btrieve 2.00
PFX Software Protection 2.00
Powerflex ODBC Driver 1.01
Powerflex Driver for Crystal Reports 1.00

For further information contact Powerflex Corporation or your local dealer.

Top of Page