REPORT FORM

REPORT FORM

Display a report

Syntax

      REPORT FORM <cReportName> [TO PRINTER] [TO FILE <cFile>] [<cScope>]
                  [WHILE <bWhile> ] [FOR <bFor> ]
                  [PLAIN |HEADING <cHeading>] [NOEJECT] [SUMMARY]
                  [NOCONSOLE]

Arguments

<cReportName> Name of report file

<cFile> Name of alternate file

<cScope> Scope.

<bWhile> Logical expression of WHILE condition .

<bFor> Logical expression of FOR condition.

<cHeading> Report heading

Description

This command prints out the report named <cReportName>, which is a standard FRM file. The file extension is not required because .frm will be assumed. The SET PATH TO and SET DEFAULT TO commands affect the search for the file <cReportName>; unless a drive and path are specified in <cReportName>, REPORT will search the path specified in the SET PATH command if it cannot find the report form in the current directory.

The output of the report will be offset based on the setting of the SET MARGIN TO value.

By default, output will go to the console; however, it may be controlled via either the TO PRINTER or TO FILE clause. If the output is to go to the file, the name of the alternate file is specified in <cFile>. Unless specified in <cFile>, the default file extension will be TXT.

<cScope> is the scope for this command. Valid scopes include NEXT <expN> (where <expN> is the number of records), RECORD <expN> (a specific record to be displayed), REST (all records from the current record position), and ALL (all records). The default is ALL.

Both logical expressions may work in conjuntion with one another, where <bFor> is the logical expression for the FOR condition (for records to be displayed within a given range) and <bWhile> for the WHILE condition (for records to be displayed until the condition fails).

If the PLAIN clause is specified, date and page numbers are suppressed. In addition, there is no automatic page breaking, and the report title and column headings appear only once at the top of the form.

If the HEADING clause is used, <cHeading> is displayed on the first title of each report page. The value of <cHeading> is evaluated only once before executing the report; varying the values of <cHeading> is not allowed. The PLAIN clause will take precedence over the HEADING clause if both are included.

If the NOEJECT clause is used, the initial page eject on the report will not be issued when the output clause TO PRINTER is specified. Otherwise, this clause has no effect.

If the SUMMARY Clause is specified, the report will contain only groups, subgroups, and grand total information. The detailed title item information will be ignored.

If the NOCONSOLE clause is specified, output to the console will be turned off while this command is being executed.

Examples

      PROCEDURE Main()
         USE test NEW
         REPORT FORM EE
         USE
         RETURN

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

LABEL FORM

Advertisements

LABEL FORM

LABEL FORM

Displays labels to the screen or an alternate device

Syntax

      LABEL FORM <cLabelName> [TO PRINTER] [TO FILE <cFile>] [<cScope>]
                 [WHILE <bWhile> ] [FOR <bFor> ] [SAMPLE] [NOCONSOLE]

Arguments

<cLabelName> Name of label file <cFile> Name of an alternate file <cScope> Expression of a scoping condition <bWhile> WHILE condition <bFor> FOR condition

Description

This command allows labels to be printed based on the format outlined in LBL file specified as <cLabelName>. By default, output will go to the screen however this output may be rerouted with either the TO PRINTER or the TO FILE clause.

If the TO FILE clause is specified, the name of the ASCII text file containing the generated labels will be <cFile>.

If no file extension is specified a .txt extension is added. <cScope> is the scope condition for this command. Valid scopes include NEXT <expN> (number of records to be displayed, where <expN> is the number of records), RECORD <expN> (a specific record to be printed), REST (all records starting from the current record position, and ALL (all records). The default is ALL.

Both logical expression may work ill conjunction with one another where <bFor> is the logical expression for the FOR condition (for records to be displayed whitin a given value range) and <bWhile> for the WHILE condition (for records to be displayed until they fail to meet the condition).

If the SAMPLE clause is specified, test labels will be generated.

If the NOCONSOLE clause is specified, the console will be turned off while this command is being executed.

This command follows the search criteria outlined in the SET PATH TO command. The path may be specified, along, with (the drive letter, in <cLabelName>

Examples

      PROCEDURE Main()
         USE test NEW
         LABEL FORM EE
         USE
         RETURN

Compliance

Clipper

Platforms

All

Files

Library is rtl

Seealso

REPORT FORM

Send to file

Write data to a file

Sending lines to a file is quite easy :

In addition of SET PRINTER on | OFF | <xlToggle> command, SET PRINTER, (like many other SET commands,) has a second form distinguished by TO keyword:

SET PRINTER TO [<xcDevice> | <xcFile> [ADDITIVE]]

The on|OFF form of SET PRINTER controls whether the output of console commands is echoed to the printer.

TO <xcDevice> identifies the name of the device where all subsequent printed output will be sent.

TO <xcFile> identifies the name of the output file. ( If a file extension is not specified, (.prn) is assumed.)

By using that last method we can send our lines to a file, instead of sending directly to printer:

 SET PRINTER TO Prnfile.txt
 SET DEVICE TO PRINTER
 SET PRINTER ON
 //
 @ 0, 0 SAY "This goes to Prnfile.txt"
 ? "So will this!"
 //
 SET DEVICE TO SCREEN
 SET PRINTER OFF
 SET PRINTER TO // Close the print file

Note that, though our target is not printer, we have use a SETting printer ON.

We have another method for sending someting to a file may be SET ALTERNATE command:

 SET ALTERNATE TO [<xcFile> [ADDITIVE]]
 SET ALTERNATE on | OFF | <xlToggle>

SET ALTERNATE is a console command that lets you write the output of console commands to a text file. Commands such as LIST, REPORT FORM, LABEL FORM, and ? that display to the screen without reference to row and column position are console commands. Most of these commands have a TO FILE clause that performs the same function as SET ALTERNATE. Full-screen commands such as @…SAY cannot be echoed to a disk file using SET ALTERNATE. Instead you can use SET PRINTER TO <xcFile> with SET DEVICE TO PRINTER to accomplish this.

SET ALTERNATE has two basic forms. The TO <xcFile> form creates a DOS text file with a default extension of (.txt) and overwrites any other file with the same name. Alternate files are not related to work areas with only one file open at a time. To close an alternate file, use CLOSE ALTERNATE, CLOSE ALL, or SET ALTERNATE TO with no argument.

The on|OFF form controls the writing of console output to the current alternate file. SET ALTERNATE ON begins the echoing of output to the alternate file. SET ALTERNATE OFF suppresses output to the alternate file but does not close it.

Examples :

This example creates an alternate file and writes the results of the ? command to the file for each record in the Customer database file:

 SET ALTERNATE TO Listfile
 SET ALTERNATE ON
 USE Customer NEW
 DO WHILE !EOF()
 ? Customer->Lastname, Customer->City
 SKIP
 ENDDO
 SET ALTERNATE OFF
 CLOSE ALTERNATE
 CLOSE Customer

A single difficulty may be making choose the best between possible methods

You can download a working example prg with a sample .dbf from here :

C5 UI – Advanced

C5 UI – Advanced

ACHOICE() :

Execute a pop-up menu

ACHOICE(<nTop>, <nLeft>, <nBottom>, <nRight>,
    <acMenuItems>,
    [<alSelectableItems> | <lSelectableItems>],
    [<cUserFunction>],
    [<nInitialItem>],
    [<nWindowRow>]) --> nPosition

BROWSE()* :

Browse records within a window

BROWSE([<nTop>], [<nLeft>],
    [<nBottom>], [<nRight>]) --> lSuccess

DBEDIT() :

Browse records in a table format

DBEDIT( [<nTop>], [<nLeft>],
    [<nBottom>], <nRight>],
    [<acColumns>],
    [<cUserFunction>],
    [<acColumnSayPictures> | <cColumnSayPicture>],
    [<acColumnHeaders> | <cColumnHeader>],
    [<acHeadingSeparators> | <cHeadingSeparator>],
    [<acColumnSeparators> | <cColumnSeparator>],
    [<acFootingSeparators> | <cFootingSeparator>],
    [<acColumnFootings> | <cColumnFooting>]) --> NIL

DISPLAY :

Display records to the console

DISPLAY <exp list>
    [TO PRINTER] [TO FILE <xcFile>]
    [<scope>] [WHILE <lCondition>]
    [FOR <lCondition>] [OFF]

LIST :

List records to the console

LIST <exp list>
    [TO PRINTER] [TO FILE <xcFile>]
    [<scope>] [WHILE <lCondition>]
    [FOR <lCondition>] [OFF]

LABEL FORM :

Display labels to the console

LABEL FORM <xcLabel>
    [TO PRINTER] [TO FILE <xcFile>] [NOCONSOLE]
    [<scope>] [WHILE <lCondition>] [FOR <lCondition>]
    [SAMPLE]

REPORT FORM :

Display a report to the console

REPORT FORM <xcReport>
    [TO PRINTER] [TO FILE <xcFile>] [NOCONSOLE]
    [<scope>] [WHILE <lCondition>] [FOR <lCondition>]
    [PLAIN | HEADING <cHeading>] [NOEJECT] [SUMMARY]

TEXT :

Display a literal block of text

TEXT [TO PRINTER] [TO FILE <xcFile>]
    <text>...
ENDTEXT

C5_REPORT FORM

 REPORT FORM
 Display a report to the console
------------------------------------------------------------------------------
 Syntax

     REPORT FORM <xcReport>
        [TO PRINTER] [TO FILE <xcFile>] [NOCONSOLE]
        [<scope>] [WHILE <lCondition>] [FOR <lCondition>]
        [PLAIN | HEADING <cHeading>] [NOEJECT] [SUMMARY]

 Arguments

     <xcReport> is the name of the report form (.frm) file that contains
     the definition of the REPORT.  If an extension is not specified, (.frm)
     is assumed.  <xcReport> can be specified as a literal string or as a
     character expression enclosed in parentheses.

     TO PRINTER echoes output to the printer.

     TO FILE <xcFile> echoes output without form feed characters (ASCII
     12) to a file.  If a file extension is not specified, .txt is added.
     You can specify <xcFile> as a literal string or as a character
     expression enclosed in parentheses.

     NOCONSOLE suppresses all REPORT FORM output to the console.  If not
     specified, output automatically displays to the console unless SET
     CONSOLE is OFF.

     <scope> is the portion of the current database file to report.  The
     default scope is ALL.

     WHILE <lCondition> specifies the set of records meeting the
     condition from the current record until the condition fails.

     FOR <lCondition> specifies the conditional set of records to report
     within the given scope.

     PLAIN suppresses the display of the date and page number, and causes
     the report to print without page breaks.  In addition, the report title
     and column headings display only at the top of the report.

     HEADING places the result of <cHeading> on the first line of each
     page.  <cHeading> is evaluated only once at the beginning of the report
     before the record pointer is moved.  If both PLAIN and HEADING are
     specified, PLAIN takes precedence.

     NOEJECT suppresses the initial page eject when the TO PRINTER clause
     is used.

     SUMMARY causes REPORT FORM to display only group, subgroup, and
     grand total lines.  Detail lines are suppressed.

 Description

     REPORT FORM is a console command that sequentially accesses records in
     the current work area and displays a tabular and optionally grouped
     report with page and column headings from a definition held in a .frm
     file.  The actual REPORT FORM file (.frm) is created using RL.EXE or
     dBASE III PLUS.  Refer to the "Report and Label Utility" chapter in the
     Programming and Utilities Guide for more information about creating
     report definitions.

     When invoked, REPORT FORM sends output to the screen and, optionally, to
     the printer and/or a file.  To suppress output to the screen while
     printing or echoing output to a file, SET CONSOLE OFF or use the
     NOCONSOLE keyword before the REPORT FORM invocation.

     When invoked, REPORT FORM searches the current SET PATH drive and
     directory if the <xcReport> file is not found in the current directory
     and the path is not specified.

 Notes

     .  Interrupting REPORT FORM: To allow the user to interrupt a
        REPORT FORM, use INKEY() to test for an interrupt key press, as a
        part of the FOR condition.  See the example below.

     .  Printer margin: REPORT FORM obeys the current SET MARGIN value
        for output echoed to the printer.

     .  Forcing formfeed characters into an output file: To include
        form feed characters when sending a REPORT FORM TO FILE, redirect
        printer output to a file using SET PRINTER like this:

        SET PRINTER TO <xcFile>
        REPORT FORM <xcReport> TO PRINTER
        SET PRINTER TO

     .  Reporting in a network environment: REPORT FORM commands
        executed in a network environment can be affected by changes made to
        database files by other users while the report is in progress.  For
        example, if a user changes a key value from "A" to "Z" while the
        report is printing, the same record could appear twice.

 Examples

     .  This example uses both a literal and an extended expression to
        execute a REPORT FORM:

        LOCAL xcReport := "Sales"
        USE Sales INDEX Sales NEW
        REPORT FORM Sales TO PRINTER FOR Branch = "100";
                  HEADING "Branch 100"
        REPORT FORM (xcReport) TO PRINTER FOR Branch != "100"

     .  This example interrupts a REPORT FORM using INKEY() to test
        whether the user has pressed the Esc key:

        #define K_ESC  27
        USE Sales INDEX Sales NEW
        REPORT FORM Sales WHILE INKEY() != K_ESC

 Files   Library is CLIPPER.LIB.

See Also: LABEL FORM LIST

 

C5 Commands

 ?|??            Display one or more values to the console
 @...BOX         Draw a box on the screen
 @...CLEAR       Clear a rectangular region of the screen
 @...GET         Create a new Get object and display it
 @...PROMPT      Paint a menu item and define a message
 @...SAY         Display data at a specified screen or printer row and column
 @...TO          Draw a single- or double-line box
 ACCEPT*         Place keyboard input into a memory variable
 APPEND BLANK    Add a new record to the current database file
 APPEND FROM     Import records from a database (.dbf) file or ASCII text file
 AVERAGE         Average numeric expressions in the current work area
 CALL*           Execute a C or Assembler procedure
 CANCEL*         Terminate program processing
 CLEAR ALL*      Close files and release public and private variables
 CLEAR GETS      Release Get objects from the current GetList array
 CLEAR MEMORY    Release all public and private variables
 CLEAR SCREEN    Clear the screen and return the cursor home
 CLEAR TYPEAHEAD Empty the keyboard buffer
 CLOSE           Close a specific set of files
 COMMIT          Perform a solid-disk write for all active work areas
 CONTINUE        Resume a pending LOCATE
 COPY FILE       Copy a file to a new file or to a device
 COPY STRUCTURE  Copy the current .dbf structure to a new database (.dbf) file
 COPY STRU EXTE  Copy field definitions to a .dbf file
 COPY TO         Export records to a database (.dbf) file or ASCII text file
 COUNT           Tally records to a variable
 CREATE          Create an empty structure extended (.dbf) file
 CREATE FROM     Create a new .dbf file from a structure extended file
 DELETE          Mark records for deletion
 DELETE FILE     Remove a file from disk
 DELETE TAG      Delete a tag
 DIR*            Display a listing of files from a specified path
 DISPLAY         Display records to the console
 EJECT           Advance the printhead to top of form
 ERASE           Remove a file from disk
 FIND*           Search an index for a specified key value
 GO              Move the pointer to the specified identity
 INDEX           Create an index file
 INPUT*          Enter the result of an expression into a variable
 JOIN            Create a new database file by merging from two work areas
 KEYBOARD        Stuff a string into the keyboard buffer
 LABEL FORM      Display labels to the console
 LIST            List records to the console
 LOCATE          Search sequentially for a record matching a condition
 MENU TO         Execute a lightbar menu for defined PROMPTs
 NOTE*           Place a single-line comment in a program file
 PACK            Remove deleted records from a database file
 QUIT            Terminate program processing
 READ            Activate full-screen editing mode using Get objects
 RECALL          Restore records marked for deletion
 REINDEX         Rebuild open indexes in the current work area
 RELEASE         Delete public and private memory variables
 RENAME          Change the name of a file
 REPLACE         Assign new values to field variables
 REPORT FORM     Display a report to the console
 RESTORE         Retrieve memory variables from a memory (.mem) file
 RESTORE SCREEN* Display a saved screen
 RUN             Execute a DOS command or program
 SAVE            Save variables to a memory (.mem) file
 SAVE SCREEN*    Save the current screen to a buffer or variable
 SEEK            Search an order for a specified key value
 SELECT          Change the current work area
 SET ALTERNATE   Echo console output to a text file
 SET BELL        Toggle sounding of the bell during full-screen operations
 SET CENTURY     Modify the date format to include or omit century digits
 SET COLOR*      Define screen colors
 SET CONFIRM     Toggle required exit key to terminate GETs
 SET CONSOLE     Toggle console display to the screen
 SET CURSOR      Toggle the screen cursor on or off
 SET DATE        Set the date format for input and display
 SET DECIMALS    Set the number of decimal places to be displayed
 SET DEFAULT     Set the CA-Clipper default drive and directory
 SET DELETED     Toggle filtering of deleted records
 SET DELIMITERS  Toggle or define GET delimiters
 SET DESCENDING  Change the descending flag of the controlling order
 SET DEVICE      Direct @...SAYs to the screen or printer
 SET EPOCH       Control the interpretation of dates with no century digits
 SET ESCAPE      Toggle Esc as a READ exit key
 SET EXACT*      Toggle exact matches for character strings
 SET EXCLUSIVE*  Establish shared or exclusive USE of database files
 SET FILTER      Hide records not meeting a condition
 SET FIXED       Toggle fixing of the number of decimal digits displayed
 SET FORMAT*     Activate a format when READ is executed
 SET FUNCTION    Assign a character string to a function key
 SET INDEX       Open one or more order bags in the current work area
 SET INTENSITY   Toggle enhanced display of GETs and PROMPTs
 SET KEY         Assign a procedure invocation to a key
 SET MARGIN      Set the page offset for all printed output
 SET MEMOBLOCK   Change the block size for memo files
 SET MESSAGE     Set the @...PROMPT message line row
 SET OPTIMIZE    Change the setting that optimizes using open orders
 SET ORDER       Select the controlling order
 SET PATH        Specify the CA-Clipper search path for opening files
 SET PRINTER     Toggle echo of output to printer or set the print destination
 SET PROCEDURE*  Compile procedures and functions into the current object file
 SET RELATION    Relate two work areas by a key value or record number
 SET SCOPE       Change the boundaries for scoping keys in controlling order
 SET SCOPEBOTTOM Change bottom boundary for scoping keys in controlling order
 SET SCOPETOP    Change top boundary for scoping keys in controlling order
 SET SCOREBOARD  Toggle the message display from READ or MEMOEDIT()
 SET SOFTSEEK    Toggle relative seeking
 SET TYPEAHEAD   Set the size of the keyboard buffer
 SET UNIQUE*     Toggle inclusion of non-unique keys into an index
 SET WRAP*       Toggle wrapping of the highlight in menus
 SKIP            Move the record pointer to a new position
 SORT            Copy to a database (.dbf) file in sorted order
 STORE*          Assign a value to one or more variables
 SUM             Sum numeric expressions and assign results to variables
 TEXT*           Display a literal block of text
 TOTAL           Summarize records by key value to a database (.dbf) file
 TYPE            Display the contents of a text file
 UNLOCK          Release file/record locks set by the current user
 UPDATE          Update current database file from another database file
 USE             Open an existing database (.dbf) and its associated files
 WAIT*           Suspend program processing until a key is pressed
 ZAP             Remove all records from the current database file

 

CL5 Printing Commands, Statements and Funtions

?/?? :

Display or print one or more values to the console or printer

? | ?? [<exp list>]

@…SAY :

Display or print data at a specified screen or printer row and column

@ <nRow>, <nCol>
   [SAY <exp>
   [PICTURE <cSayPicture>]
   [COLOR <cColorString>]]
   [GET <idVar>
   [PICTURE <cGetPicture>]
   [COLOR <cColorString>]]
   [WHEN <lPreExpression>]
   [RANGE* <dnLower>, <dnUpper>] |
   [VALID <lPostExpression>]

DEVPOS() :

Move the cursor or printhead to a new position depending on the current device

DEVPOS(<nRow>, <nCol>) --> NIL

DISPLAY :

Display or print records to the console or printer

DISPLAY <exp list>
   [TO PRINTER] [TO FILE <xcFile>]
   [<scope>] [WHILE <lCondition>]
   [FOR <lCondition>] [OFF]

EJECT :

Advance the print head to top of form

EJECT

ISPRINTER() :

Determine whether the LPT1 is ready

ISPRINTER() --> lReady

LABEL FORM :

Display or print labels to the console or printer

LABEL FORM <xcLabel>
   [TO PRINTER] [TO FILE <xcFile>] [NOCONSOLE]
   [<scope>] [WHILE <lCondition>] [FOR <lCondition>]
   [SAMPLE]

LIST :

List or print records to the console or printer

LIST <exp list>
   [TO PRINTER] [TO FILE <xcFile>]
   [<scope>] [WHILE <lCondition>]
   [FOR <lCondition>] [OFF]

OUTSTD() :

Write a list of values to the standard output device

OUTSTD(<exp list>) --> NIL

PCOL() :

Return the current column position of the printhead

PCOL() --> nColumn

PROW() :

Return the current row position of the printhead

PROW() --> nRow

QOUT() :

Display or print a list of expressions to the console or printer

QOUT( [ <exp list> ] ) --> NIL
QQOUT( [ <exp list> ] ) --> NIL

REPORT FORM :

Display or print a report to the console or printer

REPORT FORM <xcReport>
   [TO PRINTER] [TO FILE <xcFile>] [NOCONSOLE]
   [<scope>] [WHILE <lCondition>] [FOR <lCondition>]
   [PLAIN | HEADING <cHeading>] [NOEJECT] [SUMMARY]

SET MARGIN :

Set the page offset for all printed pages

SET MARGIN TO [<nPageOffset>]

SET PRINTER :

Toggle echo of console output to the printer or set the destination of printed output

SET PRINTER on | OFF | <xlToggle>
SET PRINTER TO [<xcDevice> | <xcFile> [ADDITIVE]]

SETPRC() :

Set PROW() and PCOL() values

SETPRC(<nRow>, <nCol>) --> NIL

TYPE :

Display or print the contents of a text file

TYPE <xcFile> [TO PRINTER] [TO FILE <xcOutFile>]