home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / database / p4w_all.zip / TI1352.ASC < prev    next >
Text File  |  1993-03-23  |  6KB  |  199 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox for Windows                   NUMBER  :  1352
  9.   VERSION  :  1.0
  10.        OS  :  WIN
  11.      DATE  :  March 23, 1993                           PAGE  :  1/3
  12.  
  13.     TITLE  :  Saving the Data in a Crosstab Form to a Table
  14.  
  15.  
  16.  
  17.  
  18.   Intended Audience
  19.   All Paradox Windows users.
  20.  
  21.   Prerequisites
  22.   Have, or create a crosstab form as described in Chapter 14 of the
  23.   User's Guide.
  24.  
  25.   Purpose
  26.   The need sometimes arises for saving the data in a crosstab form
  27.   to a table.  Paradox for Windows creates a temporary file during
  28.   the process of using the crosstab form, but does not save it.
  29.   This document will detail the steps necessary to save this
  30.   temporary file as a permanent database file.
  31.  
  32.  
  33.   To create the code necessary to save the data in a crosstab form
  34.   to a table, you will need to have an object on your form to
  35.   attach some code to (for example, a button).  When you click the
  36.   button, the code will run and Paradox will create a table called
  37.   Crosstab.db to hold the information in the form.  Remember that
  38.   the crosstab is an object on your form.  Here are the steps.
  39.  
  40.   STEPS:
  41.  
  42.      1.  In Design Mode on the crosstab form, right-click in the
  43.          open space at the top left hand corner on the crosstab
  44.          object.  If you get Summaries, or Categories, press ESC to
  45.          move the focus one level out and right-click again until
  46.          you get something that says #Crosstabx (where x is a
  47.          number, e.g. 3).
  48.  
  49.             a.  Press Enter (or left-click) while the #Crosstab3
  50.                 menu choice is highlighted and give the object a
  51.                 name (for example, Myxtab).
  52.  
  53.      2.  Somewhere on the form, add a button by choosing the Button
  54.          tool from the SpeedBar.
  55.  
  56.             a.  The button can be any size.
  57.  
  58.      3.  Inspect the button and select Methods from the Properties
  59.          list.
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Paradox for Windows                   NUMBER  :  1352
  75.   VERSION  :  1.0
  76.        OS  :  WIN
  77.      DATE  :  March 23, 1993                           PAGE  :  2/3
  78.  
  79.     TITLE  :  Saving the Data in a Crosstab Form to a Table
  80.  
  81.  
  82.  
  83.  
  84.      4.  Select pushButton Method.
  85.           
  86.          Add the following code between the Method and Endmethod
  87.          statements:
  88.  
  89.               YourObjectName.Action(DataSaveCrosstab)
  90.  
  91.          For example, if your object name is Myxtab, the code would
  92.          read as follows:
  93.  
  94.                    Myxtab.Action(DataSaveCrosstab)
  95.  
  96.      5.  Check the syntax
  97.  
  98.          After you have typed in the code shown above, choose
  99.          Language | Check Syntax.  The compiler examines the code
  100.          and identifies if there are syntax errors in the method by
  101.          displaying a message in the status line of the open Editor
  102.          window, such as "No syntax errors" or a description of the
  103.          syntax error.  If there is a syntax error, Paradox
  104.          positions the cursor at the point of the first error.
  105.          Before you can run the form, you will need to correct your
  106.          code and choose Language | Check Syntax again until there
  107.          are no remaining syntax errors.
  108.  
  109.      6.  When there are no syntax errors, close the method, then
  110.          run the form by pressing F8.
  111.  
  112.      7.  Click the button on your form.  Paradox will create the
  113.          temporary table called Crosstab.db in your private
  114.          directory.
  115.  
  116.      8.  Open the table to verify contents of Crosstab.db.
  117.  
  118.             a.  File | Open | Table, select :PRIV: from the Path
  119.                 directory | Crosstab.db, then choose the OK button.
  120.  
  121.             b.  The data will be arranged like it is in the
  122.                 crosstab object on the form.  Fields that are
  123.                 located in the row of the crosstab object are
  124.                 represented in the Crosstab table as the field
  125.                 called Category# (where # is a number, for example,
  126.                 Category1, Category2 etc.)  You may wish to
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.   PRODUCT  :  Paradox for Windows                   NUMBER  :  1352
  141.   VERSION  :  1.0
  142.        OS  :  WIN
  143.      DATE  :  March 23, 1993                           PAGE  :  3/3
  144.  
  145.     TITLE  :  Saving the Data in a Crosstab Form to a Table
  146.  
  147.  
  148.  
  149.  
  150.                 restructure the Crosstab table and change the name
  151.                 of any Category# fields so they correspond to the
  152.                 correct fields.  For example, if the field in the
  153.                 row of the crosstab object is Cust ID, you would
  154.                 change the field Category1 in the Crosstab table to
  155.                 Cust ID.  If you choose to restructure the Crosstab
  156.                 table, you will first need to close it.  For
  157.                 information on restructuring tables, refer to
  158.                 Chapter 9 of the User's Guide.
  159.  
  160.      9.  Since Crosstab.db is a temporary table, you will need to
  161.          rename it to a permanent table in order to save it.  Close
  162.          the Crosstab table if it is still open.  Select File |
  163.          Utilities | Rename.  Position the insertion point in the
  164.          From text box, select :PRIV:Crosstab.db from the list of
  165.          files.  Position the insertion point in the To text box.
  166.          Either select the alias that corresponds to the location
  167.          where you want the new table to reside then type a new
  168.          table name, or in type the full path name including the
  169.          new table name.
  170.  
  171.  
  172.   DISCLAIMER: You have the right to use this technical information
  173.   subject to the terms of the No-Nonsense License Statement that
  174.   you received with the Borland product to which this information
  175.   pertains.
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.