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

SP_CLABEL

CLABEL()

  Short:
  ------
  CLABEL() Menu driven module for label management

  Returns:
  --------
  Nothing

  Syntax:
  -------
  CLABEL([aInFieldNames,aInFieldDesc,aInFieldTypes],[lUseBuildex],[lRelease])

  Description:
  ------------
  This function requires no parameters and is entirely
  menu driven. Clipper compatible LBL files can be imported from.
  Definitions are stored in a DBF format. Labels may be printed by
  Query matches, by Tagging, or all records.

  Three arrays may be passed - <aInFieldNames> is an
  array of allowable field names. <aInFieldDesc>  is an array of
  field descriptions. <aInFieldTypes> is an array of field types.
  All three must be passed, or none. All fields are used as
  default, with field names being the default field descriptions.

  [lUseBuildex] if True, allows calling BUILDEX() to
  build complex expressions.

  [lRelease] if this is TRUE, CLABEL() will release the printer every
  50 labels. If on a network, this will allow the queue to empty out.
  If you are printing a bunch of labels, this can be important. Default
  is False.

  Examples:
  ---------
   use CUSTOMER

   CLABEL()

       or

   USE CUSTOMER
   aFlds := {"FNAME","LNAME","MI"}
   aFdes := {"First","Last","Middle"}
   aType := {"C","C","C"}
   CLABEL(aFlds,aFdes,aType,.t.)

  Notes:
  -------
  Requires datafile to be open.

  Reads Clipper compatible LBL files. Writes to a DBF.
  Does not call LABEL FORM. instead, uses its own label printing
  routine. Label printing routine optionally compresses blank
  lines (i.e. a 2nd address), as well as removing all but single
  space in a line (i.e. FIRSTNAME+ LASTNAME) See SLSF_LABEL() for
  notes on the storage DBF.

  Source:
  -------
  S_CLAB.PRG

 

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_LABEL FORM

 LABEL FORM
 Display labels to the console
------------------------------------------------------------------------------
 Syntax

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

 Arguments

     <xcLabel> is the name of the label (.lbl) file that contains the
     FORM definition of the LABEL and can be specified either as a literal
     file name or as a character expression enclosed in parentheses.  If an
     extension is not specified .lbl is assumed.

     TO PRINTER echoes output to the printer.

     TO FILE <xcFile> echoes output to <xcFile>.  Specify <xcFile> as a
     literal file name or as a character expression enclosed in parentheses.
     If an extension is not specified, .txt is added.

     NOCONSOLE suppresses all LABEL 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 display
     labels.  The default is ALL records.

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

     FOR <lCondition> specifies to LABEL FORM, the conditional set of
     records within the given scope.

     SAMPLE displays test labels as rows of asterisks.  Each test label
     has the same number of columns and rows as the label definition.  Then,
     following each test label display, is the query, "Do you want more
     samples?"  Answering "Y" forces another test label display.  Answering
     "N" causes LABEL FORM to display the actual labels for the specified
     scope and condition.

 Description

     LABEL FORM is a console command that sequentially accesses records in
     the current work area, displaying labels using a definition stored in a
     .lbl file.  Create the .lbl using RL.EXE or by dBASE III PLUS.  Refer to
     the "Report and Label Utility" chapter in the Programming and Utilities
     Guide for more information about creating label definitions.

     When invoked, output is sent 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 before invocation of LABEL
     FORM or use the NOCONSOLE keyword.

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

 Notes

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

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

 Examples

     .  This example prints a set of labels and writes them to a file
        with a single command.  Two forms of the command are shown:

        LOCAL cLabel := "Sales", cFile := "Sales"
        USE Sales INDEX Sales NEW
        LABEL FORM Sales TO PRINTER TO FILE Sales
        LABEL FORM (cLabel) TO PRINTER TO FILE (cFile)

     .  This example interrupts LABEL FORM using INKEY() to test if
        the user pressed the Esc key:

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

 Files   Library is CLIPPER.LIB.

See Also: REPORT FORM SET PRINTER



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