Work with the PACE Code Generator

The PACE Code Generator is a Visual Basic 6.0 add-in that is installed when you install Advanced Reporting. It generates all of the wrapper code used to implement the Advanced Reporting COM Interface which the designers can execute from PACE. It also helps developers create Advanced Reporting projects.

Access the PACE Code Generator

The PACE Code Generator functions are available from the PACE Code Generator drop-down menu, as shown below.

PACE Code Generator

The PACE Code Generator contains the following functions:

  • Generate Code. Select to restore any deleted Generated Code.

  • Add Error Handler. Selects functions in your designer, and automatically adds error handler code. It is recommended you add this error handler code to all your functions.

  • Format Reports. Select to format sections of your reports with font, color, and other property details.

  • Eagle Knowledge Base. Select to open your default web browser with the Eagle Knowledge Base Uniform Resource Locator (URL).

  • Data Dynamics News Groups. Select to open your default news reader with the Data Dynamics ActiveReports support.activereports.general news group.

  • Help. Opens Help and the Code library.

  • About PACE Generator. Select to see information about the product.

Add Error Handling to a Project

To add error handling:

  1. On the PACE Code Generator menu, click Add Error Handler.
    You see the Add Error Handler dialog box.

  2. Select the functions in which to add error handling code.

    Adding Error Handler
  3. Click Generate to insert error handling code into your project.

If a function already has error handling code it is highlighted in Yellow. Error handling code must be removed manually.

Format Advanced Reports

To add formatting to a particular section of a report or to all reports in the project:

  1. On the PACE Code Generator menu, click Format Reports.
    You see the Advanced Report Formatting dialog box.

  2. Select the report and report section to be formatted.

  3. Set the required Font, Foreground, and Background settings.

  4. Click OK to save the settings.

Select Interface Version

The version 2 interface allows you to use either DAO or ADO as the default database protocol within the exposer class. If you select ADO, an m_cn ADO connection object is added to each designer code module instead of the m_db DAO database object. With version 2, instead of a database object being passed from the PACE Advanced Reporting Engine to the VB DLL, a string with the location of the Access database is passed into the DLL. The database or connection is opened inside the VB DLL according to the defined protocol.

PACE Advanced Reporting Interface Selection Window

Inside the Advanced Reporting Visual Basic Project is a menu item for the PACE Code Generator.

Advanced Reporting Visual Basic Project Commands

Set Version and Properties

There are 2 versions of the IPACEREPORTS interface. You can set version and properties to convert DLLs from interface version 1 to version 2. All version 1 DLLs still work with the 2001 First Edition. While we recommend that all new projects use the version 2 interface, a complete conversion of all version 1 projects to version 2 is not recommended. All the features explained in this chapter can be implemented with either version interface.

To change the Interface Version, select the new version and click Modify. To disable the Advanced Report project setting, click Disable to turn off Auto Code Generation.

Customize Report Display Names

You can customize the enumerated values for the Active Report designers. The enumerated values are the values that appear in the Advanced Report Rule and Advanced Report Tester drop-down menus for report designer names. For example, the screen shot below shows a sample project with three Active Report designers. Two of these designers are shown in all drop-down menus, but the third is not. For the two displayed in drop-down menus, custom values are defined for the name property. This allows you to use business friendly names for all the drop-down menus where a business user needs to select a report designer from a Visual Basic DLL.

Define Display Names for Advanced Reporting Designers

Add AutoApproval and AutoDistribution Interfaces

To add a class to your project to implement either the automated approval or distribution COM interfaces for Client Reporting:

  1. On the Project menu, click either Add IPACEAutoApproval Class or Add IPACEAutoDistribution Class.
    The interface and required methods are added to your project.

    AutoApproval and AutoDistribution Interface Generation
  2. Insert your functional code to create an approval or distribution functionality.

  3. Or, you can right-click in the Project Explorer window to add both of these classes from the Available drop-down menu.

    Project Explorer Right-Click Menus

Set a Default DLL Configuration

To easily set up the Visual Basic DLL project, you can store the user’s preferred project configuration as a default. On the Project Configuration window, select the Save Settings as Default checkbox. When selected, the current settings are saved to the following registry key:

HKEY_CURRENT_USER >Software > EagleSystems > Clients > Advanced Reporting

When a new project is initiated, this registry key is checked for value data. If found, the project configuration defaults to the assigned values.

There are three values stored in this registry key:

  • ARVersion – ARVersion sets the ActiveReports version. This has a value of either 1 or 2.

  • DBLib – DBLib specifies if DAO or ADO is the default database library. The data value is either DAO or ADO.

  • Version – Version specifies which IPACEReport interface is used in the exposer class.

The data value is either 1 or 2. This registry key and these registry values are updated by the add-in when this check box is selected. If the registry key does not exist, it is created by the add-in.

Advanced Report Tester

Use the settings on the Advanced Report Tester dialog box to select Report File types and Advanced Report Rules.

Advanced Report Tester

When you select an Advanced Reports file, you can select the Report Document Format (RDF) file option to view Active Report image files pre-built report components into reporting packages. You can view RDF files using the Advanced Reporting Tester.

Select Advanced Report or RDF Files for Testing

After you select an Advanced Report file, you then select the Advanced Report rule containing the tables use with the DLL and designer. Any time more than one Advanced Report Rule is included in an Advanced Report Profile, the table names in the Access database are stored in the form targettablename_reportruleinstance. At run time, these table names are converted from that form to targettablename while that particular Advanced Report Rule is being imaged. After imaging, the table name is returned to its protected format. The Advanced Report Tester performs the same action for the selected Access database. The tables that are renamed in the database are those that are part of the selected Advanced Report Rule.

If a DLL and report are already defined for the selected Advanced Report Rule, they are entered automatically into the DLL and report name fields.

If a DLL and report are not yet defined for the selected Advanced Report Rule, or if you need to override the selected DLL and report, you can specify a new DLL. The drop-down menu contains the names of all the DLLs registered on the local machine that implement the PACE reporting interface, as shown below.

Select Report DLL

After the report is completed, click Print on the File menu to print the report output, as shown below.

Printing Reports

Set Up a Desktop Shortcut to AdvTest

To setup a shortcut to AdvTest using the settings on the Shortcut tab:

  1. Click the Shortcut tab.

  2. In the Start in: field, enter the directory in which your .mdb files can be accessed most easily.
    The directory you enter is the initial directory entered when you click the command to search for your database. The subsequent file windows default to the directory defined in the database lookup.

    Shortcut to ADVTEST.exe Properties Dialog