home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1993 #2
/
Image.iso
/
database
/
p4w_all.zip
/
TI1352.ASC
< prev
next >
Wrap
Text File
|
1993-03-23
|
6KB
|
199 lines
PRODUCT : Paradox for Windows NUMBER : 1352
VERSION : 1.0
OS : WIN
DATE : March 23, 1993 PAGE : 1/3
TITLE : Saving the Data in a Crosstab Form to a Table
Intended Audience
All Paradox Windows users.
Prerequisites
Have, or create a crosstab form as described in Chapter 14 of the
User's Guide.
Purpose
The need sometimes arises for saving the data in a crosstab form
to a table. Paradox for Windows creates a temporary file during
the process of using the crosstab form, but does not save it.
This document will detail the steps necessary to save this
temporary file as a permanent database file.
To create the code necessary to save the data in a crosstab form
to a table, you will need to have an object on your form to
attach some code to (for example, a button). When you click the
button, the code will run and Paradox will create a table called
Crosstab.db to hold the information in the form. Remember that
the crosstab is an object on your form. Here are the steps.
STEPS:
1. In Design Mode on the crosstab form, right-click in the
open space at the top left hand corner on the crosstab
object. If you get Summaries, or Categories, press ESC to
move the focus one level out and right-click again until
you get something that says #Crosstabx (where x is a
number, e.g. 3).
a. Press Enter (or left-click) while the #Crosstab3
menu choice is highlighted and give the object a
name (for example, Myxtab).
2. Somewhere on the form, add a button by choosing the Button
tool from the SpeedBar.
a. The button can be any size.
3. Inspect the button and select Methods from the Properties
list.
PRODUCT : Paradox for Windows NUMBER : 1352
VERSION : 1.0
OS : WIN
DATE : March 23, 1993 PAGE : 2/3
TITLE : Saving the Data in a Crosstab Form to a Table
4. Select pushButton Method.
Add the following code between the Method and Endmethod
statements:
YourObjectName.Action(DataSaveCrosstab)
For example, if your object name is Myxtab, the code would
read as follows:
Myxtab.Action(DataSaveCrosstab)
5. Check the syntax
After you have typed in the code shown above, choose
Language | Check Syntax. The compiler examines the code
and identifies if there are syntax errors in the method by
displaying a message in the status line of the open Editor
window, such as "No syntax errors" or a description of the
syntax error. If there is a syntax error, Paradox
positions the cursor at the point of the first error.
Before you can run the form, you will need to correct your
code and choose Language | Check Syntax again until there
are no remaining syntax errors.
6. When there are no syntax errors, close the method, then
run the form by pressing F8.
7. Click the button on your form. Paradox will create the
temporary table called Crosstab.db in your private
directory.
8. Open the table to verify contents of Crosstab.db.
a. File | Open | Table, select :PRIV: from the Path
directory | Crosstab.db, then choose the OK button.
b. The data will be arranged like it is in the
crosstab object on the form. Fields that are
located in the row of the crosstab object are
represented in the Crosstab table as the field
called Category# (where # is a number, for example,
Category1, Category2 etc.) You may wish to
PRODUCT : Paradox for Windows NUMBER : 1352
VERSION : 1.0
OS : WIN
DATE : March 23, 1993 PAGE : 3/3
TITLE : Saving the Data in a Crosstab Form to a Table
restructure the Crosstab table and change the name
of any Category# fields so they correspond to the
correct fields. For example, if the field in the
row of the crosstab object is Cust ID, you would
change the field Category1 in the Crosstab table to
Cust ID. If you choose to restructure the Crosstab
table, you will first need to close it. For
information on restructuring tables, refer to
Chapter 9 of the User's Guide.
9. Since Crosstab.db is a temporary table, you will need to
rename it to a permanent table in order to save it. Close
the Crosstab table if it is still open. Select File |
Utilities | Rename. Position the insertion point in the
From text box, select :PRIV:Crosstab.db from the list of
files. Position the insertion point in the To text box.
Either select the alias that corresponds to the location
where you want the new table to reside then type a new
table name, or in type the full path name including the
new table name.
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.