Custom Report Maintenance

Menu Path: System Administration Images\bluerarw.gif Tools Images\bluerarw.gif Customization Images\bluerarw.gif Custom Report Maintenance

Purpose

Set up and maintain custom reports.

Overview

Use Custom Report Maintenance to create or edit custom report records that you can set up as custom windows in Custom Program Wizard, or to delete custom reports you no longer want to use. You can also set up the column heading labels for outputting custom reports to Excel. For a custom report, you must create both a custom program (.p) and a custom Crystal Reports form (.rpt).

Creating Custom Reports

To create a custom report:

  1. Click the New button in the ribbon.

  2. Enter the name of the report in the Report Name field. This should be the same as the file name of both the custom program and custom Crystal Reports form (without file extensions). When you enter the report name, custom program and custom Crystal Reports form file names are entered automatically in the Report Filename and Program Name fields.

  3. Enter a title for the report in the Report Title field.

  4. Set up column headings for the report when it is output to Excel.

    1. Enter a field name that is included in the temp table in the custom program in the Field Name field.

    2. Enter the column heading that you want to appear in Excel for the field in the Field Label field.

    3. Click the Add button.

    4. Repeat substeps a to c for all fields in the temp table.

  5. Click the OK button in the ribbon. The custom report is created.

Sample Program

The following is a sample program, which illustrates how you should create your custom programs:

{cust-rpt.i}   /*This .i has some necessary procedures for the custom report*/

/*Report tables definition*/

DEFINE TEMP-TABLE report-data NO-UNDO

   FIELD prod-cat AS CHAR

   INDEX idx-main IS PRIMARY prod-cat.

DEFINE TEMP-TABLE report-trl NO-UNDO

   FIELD prod-code AS CHAR

   FIELD prod-name AS CHAR

   FIELD prod-cat AS CHAR

   INDEX idx-main IS PRIMARY prod-code.

PROCEDURE run-report:

   {cust-rpt-input.i}  /*This .i includes input parameters passed in by the system, and also it will do some initialization*/

   /*Tell the system which report tables are used in the report.

     In this example it uses two tables. You can add more tables

     by separating them with "," */

   RUN set-report-buffers("report-data,report-trl").

   /*Retrieve data from the database*/

   FOR EACH category WHERE

            category.system-id = "Apprise"

            NO-LOCK:

      CREATE report-data.

      ASSIGN report-data.prod-cat = category.category-code.

      RELEASE report-data.

      FOR EACH product WHERE

               product.system-id = "Apprise"

               NO-LOCK:

         CREATE report-trl.

         ASSIGN report-trl.prod-code = product.product-code

                report-trl.prod-name = product.product-name

                report-trl.prod-cat = category.category-code.

         RELEASE report-trl.

      END.   

   END.

   OPEN_CUSTOM_REPORT(). /*Open the report*/

END.

Ribbon Home Tab Buttons

Button

Description

Exit

Click this button to close the Custom Report Maintenance window.

New

Click this button to create a new report.

Update

Click this button to edit the selected report.

Delete

Click this button to delete the selected report.

OK

Click this button to accept an action. This button only appears after you click the New, Update, or Delete button in the ribbon.

Cancel

Click this button to cancel an action. This button only appears after you click the New, Update, or Delete button in the ribbon.

Label Maintenance

Click this button to display Label Maintenance, which allows you to set up and maintain labels displayed in Apprise.

Fields and Buttons

Field or Button

Description

Report Name

Enter a name for the report, or click the Lookup button to select an existing report name.

Report Filename

Enter a file name for the report, or click the Lookup button to select an existing report file name.

Example Report1.rpt

Main Tab Fields and Buttons

Field or Button

Description

Program Name

Enter the custom program name for the report.

Example Report1.p

Report Title

Enter a title that appears on the output report, or click the Lookup button to select a previously saved label. If a label was previously set up in Label Maintenance, you can enter the label code in the second field, or click the Lookup button for that field to select a label code. You can also click the button to the right of these fields to display Label Maintenance, which allows you to maintain labels displayed in Apprise.

Field Name

Enter a field name for a field on the report for which you want to define a column heading for Excel output. This must be a field name in the temp table defined in the program entered in the Program Name field.

Field Label

Enter a field label for the field on the report when it is output to Excel, or click the Lookup button to select a previously saved label. If a label was previously set up in Label Maintenance, you can enter the label code in the second field, or click the Lookup button for that field to select a label code. You can also click the button to the right of these fields to display Label Maintenance, which allows you to maintain labels displayed in Apprise.

Add

Click this button to add the field name and label to the Fields grid.

Remove

Click this button to remove the field name and label from the Fields grid.

Fields

This grid displays fields for the report. You can edit the label and label code for each field.