text
stringlengths 11
3.5k
| source
stringclasses 1
value |
---|---|
Crosstab objects A crosstab is a data analysis tool that summarizes (cross-tabulates) information according to one or more categories. The categories on a crosstab are fields. The summarized data for a crosstab is created by a query. Because crosstabs automatically create and run queries, itis not necessary to define a query to create a crosstab. It is, however, a wayto understand the type of information a crosstab can contain. See Working with crosstabs on page 299 for more information aboutcrosstabs and their properties. Placing a crosstab on a form or report When you place a crosstab on a form or report, the crosstab uses the datamodel of that form or report. To place a crosstab in a form or report 1Open a form or report in the Design Window, click the Crosstab tool. 2Click the form or report to create a crosstab at its default size, or click anddrag to size the crosstab. An empty crosstab object appears with undefined fields in the row header, column header, and first summary area. Changing crosstab properties A crosstab object is a composite object made up of: fields row area column area summary area Each part of a crosstab has unique properties, and the crosstab object as a whole has properties. To change properties of the entire crosstab Open a form or report in the Design Window, right-click the upper leftcorner of the crosstab and click Properties. Working with design objects397 | 292806769-Paradox-9-Eng.pdf |
To change properties of a portion of the crosstab Open a form or report in the Design Window, right-click a portion of the crosstab and click Properties. Field objects You can place a field from a Paradox table on a form or report. Field objectsdisplay data from the tables(s) on which the form or report is built. In the Design Window, you do not see the data in the field. When you run the formor report, Paradox displays the fields data in the field object. When you create a form or report and choose any layout other than blank from the Design Layout dialog box, Paradox places the fields from your tablein the design. You can place more fields on the design. Field objects in reports In reports, you must follow certain rules when you place field objects inmulti-table report designs. If the field object is defined as a field of the master table, you can place it in any band. If the field object is defined as a field of the detail table, it must be placedwithin the detail tables repeating region (a table frame or multi-regionobject). See the Object property reference in the online Help for more informationabout the properties associated with fields. Placing a field on a form or report You can place a field on any form or report. You must define the field so thatit is linked to a field on a table in your data model. When you run the form orreport, Paradox displays the data from that field of the table for each recordyou display. Placing a field object Depending on the properties of the tool, the field may be a labeled field, anedit field, a list box, combo box, a radio button, or a check box. You can alsoplace a field that is not available from the menu (such as a summary field, aspecial field, or a calculated field), or you can leave the field undefined. 398 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
To place a field object 1Click the Field tool on the tool bar. 2Click to place the field object using its default size, or click and drag to place the field object and specify its size. By default, Paradox creates a labeled field object, which consists of the label (a text object) and the edit region in which the fields data appears. To define the table field you want to display 1Right-click the field object and choose Define Field. The Define Field Object dialog box displays a list box of each table used in the form. 2Choose a field from the appropriate tables list box. T o define a field, the form or report must be connected to a data model. Using the Field Palette The Field Palette allows you to quickly add table fields to a form or report. Itcontains the names of all the tables in your working directory. When youchoose a table from the list box, the bottom panel of the Field Palette displaysall of the fields in that table. To open the Field Palette Open a form or report in a Design Window, click View, Field Palette. To add a field to a form or report using the Field Palette 1Choose a table from the Field Palette list box. 2Drag the field from the list to your form or report. Paradox adds the field to the form or report. If you add a field from a table that is not already part of the forms or reports data model, Paradoxprompts you to confirm adding the table to the data model. Once you add a field, you can define the field and set its properties. Working with design objects 399 | 292806769-Paradox-9-Eng.pdf |
Specifying the functionality of a field object There are six types of field objects: Combo fields, List fields, Edit fields, Radio Button fields, Check Box fields, and T oggle buttons. Combo field objects When users enter data using a list-box field, they can either type a value inthe edit region, or choose the data value from a list box. Use a list box fieldobject to provide users with a quick way to enter data into a field that has alimited number of valid values. When you create the field object, you specifythe valid values in the Define Values dialog box; users pick from these valueswhen they enter data while running the form. For example, if you create a data-entry form for the Orders table and you know of six common values for the Payment Method field, you can displaythese values in a list-box field object. These field objects are unavailable in reports. List field objects A list field offers users a list of values from which to choose. Users choose from the list to select a value and can only select values that are listed. Onlyone value can be selected at a time. Use a list-field object to provide userswith a quick way to enter data into a field that has a specific number of validvalues. When you create the field object, you specify the valid values in the Define Value dialog box; users pick from these values when they enter datawhile running the form. For example, if you create a data entry form for the Orders table and you know that only five values are valid for the Ship Via field, you can displaythese values in a list-field object. Edit field objects A field where the user can view or enter data. T o view values of a table, theform or report must be connected to a data model. This is valuable to userswho want to view a specific field one record at a time. Instead of selecting therecords from a list, use the navigation buttons to move through the records. When you create the edit field, you specify the values in the Define Value dialog box; users pick from these values when they enter data while runninga form. Editing the label does not change the value in the field; you mustalter the field in the Define List dialog box. 400 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
Radio Button and Toggle Button field objects Radio buttons and toggle buttons perform the same functionality. Both offer users a list of values from which to choose. Users enable a button to select avalue from the list. Use these field objects to provide users with a quick wayto select data from a field that has a specific number of values. When you create the field object, you specify the valid values in the Define List dialog box; users pick from these values when they enter data whilerunning the form. Changing the label of a button in the Design Window doesnot alter the fields value. You must alter the value in the Define List dialogbox. Check Box field objects A check box has two states: enabled and disabled. The user enables thecheck box, an X appears in the box; when disabled, the box is blank. The fieldhas one value when enabled another value when disabled. The check boxvalues are defined in the Check Box Values dialog box. A logical field type isa perfect candidate for a check box display type. Its also a good idea to createa default validity check on the logical field and to specify False as the defaultvalue. For all fields other than logical fields, any values can be entered for the check-box values. True and false must be used as the values in a logical field. Changing the label of a check box in the Design Window does not alter thefields value. You must alter the value in the Check Box Values dialog box. For example, suppose you design a form using the Vendors sample table. The Preferred field, a logical field, indicates whether the vendor has preferredstatus or not. You could define the field as a check box, and define the valuesfor the check box as true when enabled and false when left blank. If theuser enables the box, true is entered into the tables field for that record. Ifthe user leaves the box disabled, a false value is entered. Specifying a field objects display type You can choose from labeled, edit, combo, list, radio button, or check box fieldobject. To specify a field objects display type 1Open a form or report in the Design Window. 2Right-click the field and click Properties. 3Click the General page. 4Choose an option from the Display type list box. Working with design objects 401 | 292806769-Paradox-9-Eng.pdf |
5Click Define Values. 6T ype one of the following: In the Define List dialog box type the values that you want to appear in the field and press ENTER. Repeat for each additional value. In the Check Box Values dialog box type the values you want the boxto have when checked or unchecked. To change the values for a field object 1Follow steps 1 and 2 from the above procedure. 2Choose the appropriate type of field from the Display T ype list box on the General page of the Properties dialog box. 3Click Define Values. 4In the Define List or Check Box Values dialog box, type in new values forthe object. If you change display types from an unlabeled field to a labeled fieldwithout enabling the Size T o Fit check box on the Design page of the Properties dialog box, the field remains the same size and the label objectand field object compete for space. When you enable Size T o Fit, the fieldobject expands to accommodate the new label. See Display T ype property in the Object property reference in the online Help for more information about field display types. Changing a label without changing the field value For radio-button and check-box field objects, the values you define as choicesfor the fields are those that Paradox enters in the table when a user entersinformation by using that form. The default labels on the form match thesevalues. However, you can change the labels on the form without changing thevalues the user can select. The labels are standard text objects on the form. To change the labels after defining the values 1Open a form or report in the Design Window. 2Select the text label on the object by clicking the text until a flashingcursor appears. 3T ype the text for the label. 402 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
4Without clicking again (the insertion point is still inside the text), move the mouse to any of the borders of the text box. Stop when the cursorchanges to a double-headed resizing arrow to indicate the direction youcan drag. 5Click and drag in the indicated direction to resize the text area. Special fields A special field in a form or report contains information about the table orabout the design as a whole. It is not a field of a table. Table The special fields that relate to a table are: <Table Name> (The tables name) <Record Number> (The current record number) <Number of Records> (The number of records in the table) <Number of Fields> (The number of fields in the table) These fields are found on the master-table list box and are displayed in brackets, for example, <Table Name>. Design The special fields that relate to the design as a whole are: Date (T odays date ) Now (The current time) Page Number (A page number) Timestamp (The current time and date) Number of Pages (The number of pages in the form or report) These special fields are found in the Define Field Object dialog box on the list box in the Special Field area. Placing a special field on a form or report Although a special field is created just like any other field, it cannot be editedthe way other fields can. Its purpose is to display information about the formor report, not to be an editing tool. Working with design objects 403 | 292806769-Paradox-9-Eng.pdf |
To place a special field on a form or report 1Open a form or report in a Design Window. 2Click the Field tool. 3Click in the design area to create the field object. 4Right-click the field object and click Define Field. 5Choose one of the following: For a field related to the table, choose a field from the list box that contains the name of the table. These special fields are bracketed at thebottom of the list, for example, <Number of Records>. For a field related to the design, choose the appropriate field from the Special Field list box. T o define a field, the form or report must be connected to a data model. Summary fields A summary is a type of field calculation in forms and reports. You can usesummaries to sum, count, or average the values in a field. You can find theminimum, maximum, standard deviation, and variance of values in a field. Ifyou want a field to calculate a value based on more than one field, you willrequire a calculated field. See Calculated field objects on page 412 for moreinformation. Paradox has the following summary operators: Summary Description Sum Sum of non blank values to use with number types. Count Number of non blank values to use with all data types. Min Minimum value to use with alpha, number, money and date data types. Max Maximum value to use with Alpha, number, money and date data types. Avg Divides the total of all non null values by the number (count) of all non null values to use with number data types. Std Standard deviation of values to use with number data types. Var Statistical variance of values to use with number data types. First* First value to use with all data types. 404 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
Last* Last value to use with all data types. Prev* Previous value to use with all data types. * These operators are not available in forms. Normal, cumulative, and unique report summaries When you create a report, you can choose from the following types of summaries. These options appear below the list of summary operators in the Define Field Object box. Normal considers all non null values in the set, including duplicates. Unique counts only unique non null values in the set. Duplicates are ignored. If you use a unique summary to perform a Sum or Avg function,you will not obtain true results because some values (duplicates) are notconsidered when the operation is performed. A common use of a unique summary is to count all unique values in a set. For example, how many different types of items does a certain customerorder? Cumulative keeps a running total that extends from the start of thereport to the end of the current set, instead of from the beginning of thecurrent set to the end of the current set. For example, if you place acumulative Sum summary on a Balance Due field, Paradox initially setsthe value to zero, and then keeps a running total from the start of thereport through to the end of the report. Summary scope A summary performs a calculation on a set of records. Before you canperform an operation on the set, you must define the set by defining thescope of the summary. The scope specifies on which values you want thesummary to operate. Forms In a single-table form, Paradox works with only one set of data. In thiscase, the scope of the summary is the whole table. In a multi-table form, the scope of a summary depends on the datahierarchy. The hierarchy is defined by the forms data model. Example of creating a summary scope on a multi-table form Suppose you have defined your data model as follows: Customer Orders Lineitem Working with design objects 405 | 292806769-Paradox-9-Eng.pdf |
You can summarize values for fields in the Orders table for each record in the Customer table. In this relationship, Customer is the master table and Orders is the detail table. Paradox sums the set of Orders detail records forthe current Customer record. Likewise, you can summarize values in the Lineitem table for the current record in the Orders table. Again, the master table (Orders) determines thescope of a summary on the detail table (Lineitem). The summary of Lineitemis performed on the set of all items for the current customers current order. In the data model Customer Orders Lineitem, you cannotcreate a summary of each customers lineitems only of each orderslineitems. Paradox can move up only one level in the data hierarchy whenperforming a summary. When placing a summary field on a set of detail records in a one to manyrelationship in a form, you must position the summary field within thatdetails repeating region (the table frame or multi-record object thatdisplays its records) or within the repeating region of the next table up inthe data hierarchy. Reports Both the reports data model and the placement of the summary field inthe report design determine the scope of a reports summary. Summary scope on single-table reports When you place summaries in a single-table report, location affects the scopeas follows: Corresponding band headers and footers calculate to the same value. This means you can place a summary in either the report header or reportfooter and get the same result. Likewise, a calculation in either the pageheader or page footer yields the same result. In a table frame, the scope of the calculation is over all records in the table(if it is a detail table, the scope is all records in the detail set). In a report band (either the header or the footer area), the scope of thecalculation is all values contained by the report band all records for thetable. 406 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
In the page band (either the header or the footer area), the scope of the calculation is all values contained by the page band all records on thepage. In a group band (either the header or the footer area), the scope of thecalculation is all values contained by the group band all records for thegroup. In a record band, a summary will behave differently in different situations. Ina report without a group band, Paradox performs the summary on all recordsin the table. In a report with a group band, Paradox performs the summary onall records in the group. In a tabular or multi-record report, if the Run Timeproperty Show All Records of the table frame (or multi-record object) isdisabled, Paradox performs the summary on the number of records that fit inthe table frame or multi-record object. In this case, the table frame ormulti-record object acts as if it were a band defined as a number of records. Summary scope on multi-table reports When you place summaries in a multi-table report, location affects the scopeas follows: Summaries on master tables When you place a summary field on the master table of a multi-table report,the scope of the summary is the innermost group of data. When you place a summary field in the record band of a report based on tables with a one-to-many relationship, the summary can calculate only onthe current record of the master table. In this case, the current master recordbehaves like a group band and groups the detail records. When Paradox works with a data model that contains one-to-many or many-to-one relationships, Paradox joins the two tables in the data modelbefore it performs the summary, and then treats the joined tables as a singletable. Summaries on detail tables When you place summaries on the detail table of a multi-table report, therecord, page, and group band rules for summaries on single-table reportsremain true. In addition, if you place a summary in the record band, Paradoxperforms the summary on all detail records of the current master record. Ifyou embed a summary within a table frame or multi-record object defined asthe master table, Paradox performs the summary on each record of themaster table. Working with design objects 407 | 292806769-Paradox-9-Eng.pdf |
Summaries on unlinked tables When you place a summary on an unlinked table in a multi-table report, the sum is performed for the whole table. Defining a summary A summary performs specific calculations on a specific set of values in atable. The set of records over which the summary is made is called its scope. The scope is determined by the location of the summary field in the form orreport. To define a summary 1Right-click the field on which you want to perform the summaryoperation, and click Define Field. 2In the Table list box, choose the field on which you want to perform thesummary operation. 3Choose the appropriate summary type from the Summary list box. Returning a summary value relative to a particular report page In a report that uses tables linked by a one-to-many relationship, if you wantto perform a summary operation which is relative to a page and based on afield in the detail table, you may need to link the tables backward in the datamodel. For example, if your report is based on two detail tables, you may have more than one page of detail data. Because of the links, Paradox automaticallygroups the records in the detail table. Summary operations on a field within agroup do not respect page breaks and return a value for the group, not foreach page on which the grouped data appear. The solution is to link from the detail table to the master table. There will be no inherent grouping by Paradox. You can then group on a particular field, oreven a set number of records, and have a summary value returned relative toa particular page. To return a summary value relative to a particular page 1In Design mode, click Format, Data Model. 2Choose the details table in the Data Model designer, and click Unlink. 3Redraw the link so that the old details table becomes the master table. 4Define the summary as shown in Defining a summary on page 408. 408 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
For more information on creating links in data models, see Linking tables in a data model on page 174 or Understanding links and indexes onpage 176. Example of creating an Avg summary on a single-table form Suppose you want to know what average quantity your customers order perline item. To create an Avg summary on the LINEITEM. DB table 1Create a form based on the LINEITEM. DB table, click Form, New, Data Model. 2Select LINEITEM. DB, click OK. 3In the Define Layout dialog box, select the layout and fields you want toinclude in the form. The form opens in the Design Window. 4Click the field object tool in the Design Object toolbar, click an area of the form to place the object. 5Right-click the field object, and click Define Field. 6In the Define Field Object dialog box, choose Qty from the LINEITEM. DB list box. 7Choose Avg from the Summary list box. 8Click OK to return to the Design Window. Paradox changes the fieldobjects label to Avg(Qty). 9Click View, View Data to run the form. Paradox calculates the average of all quantities ordered and displays the value in the summary-field object. Example of creating a count summary in a report Suppose youre working with a tabular report on the sample Customer tableand want to know how many customers you have in each country. Defining a count summary in a report 1In the Report Design Window, create a group band on the Country field of Customers. See Adding or defining a group band on page 262. Working with design objects409 | 292806769-Paradox-9-Eng.pdf |
2Click the Field tool on the T oolbar, drag in the group band to place an undefined field object below the Country field. 3Right-click the field object, and click Define Field. 4Choose the Customer No field from the CUSTOMER. DB list box. 5Choose Count from the Summary list box. 6Click OK to return to the Design Window. 7Click File, Print to print the report. For each unique country value, Paradox shows the country name, the number of customers in that country, and a table frame that displayscustomer information. When you print or preview a report, Paradox performs the calculationdefined by the summary and returns a value. In the example of thecount-by-country summary, Paradox looks at the record band for eachgroup and returns the number of records in that band. When you define a count, it is a good idea to count the values in a tablesprimary-key field. Because a primary-key field must contain data, you willbe sure to get an accurate count. Memo fields When you create a memo or formatted memo field, you specify how much ofthe memo Paradox stores in the table. The entire memo is stored in adifferent file. For more information see Creating a Paradox table on page53. The time it takes Paradox to access the. MB file (Paradox stores memo data in a file with the name of the table and a. MB extension) and display itsinformation in your form depends on a variety of factors, such as the size ofthe memo and the speed of your system. T o increase performance, you candisplay only the data stored in the table. Displaying memo field contents You can choose to display only the first line of text in a memo field, or displaythe entire contents of the field. 410 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
To display the entire contents of a memo field 1Open a form or report in the Design Window. 2Right-click the memo field, click Properties. 3Click the Run Time page. 4Enable the Complete Display check box. Protecting and hiding data in a field In the run time version of your database, there are times when you want the user to be able to view a field, but not be able to change it. You can make afield read-only by using a password. You can also suppress the contents of a field when you run a form. The field is visible, but not its value. This is especially useful for entering passwordsor other protected information. Protecting or hiding a fields contents You can prevent a fields data from being changed when you run a form. T oprevent someone from changing data in a field no matter how they access thefield (from a table, any form, or a query), use a read-only auxiliary password. For more information see Passwords on page 73. To make a field read-only 1Open a form in the Design Window. 2Right-click the field, click Properties. 3Click the Run Time page. 4Enable the Read Only check box. To hide a fields contents 1Follow steps 2 and 3 of the above procedure. 2Enable the No Echo check box. Paradox will not display data you enter in the field. For more information on the Echo check box, see No Echo property in the Object property reference online Help. Working with design objects 411 | 292806769-Paradox-9-Eng.pdf |
Calculated field objects A calculated field in a form or report performs a calculation on the values of one or more fields. The calculation is an expression (which might haveseveral components or terms) that must resolve to a single data value. If youonly want to calculate a value based on the values in one field, you should usea summary field. See Summary fields on page 404 for more information. Calculated fields are commonly used to determine values from two or more fields in a table. For example, you can create a field object in a form on the Lineitem table and define the field as a calculated field by using the formula [LINEITEM. Qty] * [LINEITEM. Selling Price] The value of a record in this calculated field is the product of the values of the Qty and Selling Price fields. Why use a calculated field? Calculated fields are space savers in tables. In most cases, users want tosee calculated results in reports and forms. Calculated fields performcalculations on existing data only at runtime (for example, when you viewa report). This eliminates the need to store excess data in the table. Calculated fields offer a broad range of functionality. You can use calculatedfields to perform many different operations besides mathematicalcalculations. You can use them to concatenate string values, call built-inand custom methods (those returning a single value), base operations onlogical criteria, and perform special functions (such as Sum and Average). The combination of these and other attributes can be powerful additionsto your application. Storing values from calculated fields in a table Values in calculated fields, whether in a form or report, are not stored in thetable. Values are created strictly for viewing or printing purposes. If you wantto store these values, perform the calculation in a query. Calculated fields and summary fields You can place calculated fields and summary fields on a form or report. A calculated field performs a calculation on a set of records. Before you can perform an operation on the set, you must define the set by defining thescope of the calculation. The scope of a calculated field is the same as that ofa summary field. A summary is a type of field calculation. You can use summaries to sum, count, or average the values in a field. You can find the minimum, maximum,standard deviation, and variance of values in a field. See Summary fields 412 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
You create calculated fields and summary fields in the Define Field Object dialog box, which you can open by right-clicking the field and choosing Define Field. Calculations on summary fields In reports, you can perform calculations on the values generated bysummaries. For example, you can group the Orders table by Customer No and then create a summary field T otal Due to sum the Balance Due field. Thisreport would tell you the amount that each customer owes. Suppose a new policy requires you to charge each customer $5 if they have an outstanding balance. You can create the following formula: [ORDERS. Balance Due]+5 As the report runs, Paradox adds all the values in the Balance Due field foreach customer, then adds five to the total. Summaries on calculated fields Calculated field expressions can contain summary operators. For example,the sum of all invoice totals from the Orders table multiplied by a sales tax of7. 75% could be expressed as follows: SUM([ORDERS. Total Invoice]) *. 0775 You could also calculate the sum of all line item totals (in a given scope) andmultiply that value by a sales tax of 7. 75% using the following expression: SUM([LINEITEM. Qty]*[LINEITEM. Selling Price])*. 0775 Creating calculated fields Calculated fields can include arithmetic operators +,-, *, /, and () logical operators AND, OR, and NOT comparison operators <, >, <>, =, >=, and <= summary fields (sometimes called aggregates). For example SUM([table. field A] + [table. field B]) SUM([table. field A]) + SUM([table. field B]) object references, such as the name of an object on the form. (Objectnames are always unique. ) numeric constants alphanumeric strings Working with design objects413 | 292806769-Paradox-9-Eng.pdf |
any of the Object PAL mathematical, statistical, string manipulation, and date/time methods that return a single value custom Object PAL methods or procedures that are defined in forms orcontained in libraries and accessed by forms. (Custom methods are notaccessible by reports. ) combinations of any of the above Referring to fields and field objects The field object in a form or report design is not the same as the actual fieldin the table that the field object represents and contains. This distinction isimportant to remember when you use field names in calculations. Forexample the expression Qty * Price performs a calculation on the field objects named Qty and Price the expression [LINEITEM. Qty] * [LINEITEM. Price] performs acalculation on the values in the actual Qty and Price fields in the Lineitemtable The field object in the design and the field in the table to which the form isbound are usually equivalent. At times, however a field object is not associated with a table (for example, it might be another calculated field) a field object might be unbound (not associated with a field in any table)and not defined as a calculated or special field a field from a table in the data model is not displayed in the design, butyou must reference its field value A field object might not have the same name as the field to which it is bound. Creating a calculated field To create a calculated field 1Right-click the field object, and click Define Field. 2Enable the Calculated check box. 3T ype the calculation you want in the Calculated box. Example of calculating with a summary operator You can use calculated fields in forms and reports to generate field valuesthat you might otherwise store in the table itself. For example, tables aresometimes designed with quantity, selling price, and total invoice amount 414 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
fields. The total invoice is the price multiplied by the quantity. When you use calculated fields and summary operators, the total invoice field need not bepart of the actual table. You can instead create a field in your form or reportthat calculates the total invoice value. The following expression generates the total for each record in the Lineitem table: [LINEITEM. Qty]*[LINEITEM. Selling Price] This expression can be a defined in a calculated field object in a table frameor multi-record object. When you define a calculated field, you must type a value in the fields label. When you define the field as calculated, Paradox shows formula in the fieldobject. When you run the form (or print or preview the report), Paradox calculates the total for each record by multiplying the Selling Price value by the Qtyvalue for each record in the table. You can create a calculated field that calculates the total of all line items, rather than the total of individual records. T o generate the total of all lineitems in a given scope, you could use the following expression: SUM([LINEITEM. Qty]*[LINEITEM. Selling Price]) The example above illustrates how you must use the sum() operator witha calculation. A reference to the UIObject name of a calculated field thatcontains the same calculation is not valid with the SUM() operator. Using a field name in a calculation When you create a calculated field on a form or report, the table name thatfield references is saved as part of the. FSL or. RSL file. If you open the formor report with a different table, the calculated fields may not be updated toreflect the change. Therefore, the calculation tries to reach information in atable (or tables) that is not bound to the document. Punctuation marks, particularly periods, are reserved characters in Paradox. Paradox uses dot notation to reference objects within forms and reports, anduses periods (dots) in field names to invalidate this process. If you use the Copy Field button when you define a field, you can easily copy a punctuatedfield into the calculated field box. If the field name has periods in it, such as T otal. Invoice, Paradox looks on the report or form for an object named T otalcontaining another object called Invoice. Consequently, field names withpunctuation can cause errors when you use them in a calculated field. Working with design objects 415 | 292806769-Paradox-9-Eng.pdf |
To use a field name in a calculation 1Open a form or report in the Design Window. 2Right-click the field, click Define Field. 3Choose the field you want from the tables list box. The field name appears in the box at the top of the Define Field dialog box. 4Enable the Calculated check box. 5Choose Copy Field to place that field in the Calculated box. To reference another calculated field on the same form or report 1Right-click the field objects and click Properties to determine their objectnames (displayed in the Name Of Object text box on the General page ofthe Properties dialog box). 2Use these names in the calculation. To update calculated fields when opening a form or report with a different table Redefine the calculated fields so they refer to the new tables, and save the form or report. To use a field name that contains punctuation in a calculated field Enclose the field name in quotes. When Paradox places the field name in the box, it is selected. Move the cursor to deselect the field name before you begin typing. (If youaccidentally type and replace the selected field name, press ALT +BACKSPACE to restore the name. ) In addition to the field name, the directory alias (if any) of the table andthe tables name are visible. For example, if you choose the Balance Duefield from the Orders table (and the Orders table is in your workingdirectory), [:WORK:ORDERS. Balance Due] appears in the Calculated textbox. This points to the exact location of the field in the expression. 416 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
If you have assigned a table alias to a table, use that alias instead of the tables name when you define calculated fields. When an object is used in another calculated field or expression or in areport, you can rename the object so it is easily recognizable. T o changethe name, type in the desired name on the General page of the Field Properties dialog box. Aligning a calculated field with data in a table frame If you place a calculated field in a table frame column, for example, at thebottom of a column of numbers, you need to align the decimal points in thecalculated field with the decimal points in the numbers in the column. To align a calculated field with data in a column of a table frame in a report 1Place the calculated field in the table frame. 2Select the edit region on the calculated field. 3Hold down SHIFT and click the field region of the table frame. 4Click Format, Alignment, Align Right. 5Right-click the edit region of the calculated field and click Properties. 6Click the Run Time page, and disable the Fit Width check box. Example of calculating with a field and a constant Calculated fields can be used to perform calculations that include a field and a constant. For example, suppose you want to show what the selling price ofline items would be if you raised all prices by 25%. 1Create a form bound to the Lineitem table, click Form, New, Data Model. 2Select Lineitem. db 3Choose the tabular layout and the fields for your form. The form opens into the Design Window. 4Select the field object from the Design Object T oolbar, and place it on the form. 5Change the field label to the following: Selling Price increased by 25%: (To change the field label, click three times on the field to place the cursorinside the text, then type the new label. ) Working with design objects417 | 292806769-Paradox-9-Eng.pdf |
6Right-click the field object and click Define Field. 7In the Define Field Object dialog box, enable the Calculated check box. 8T ype the following formula in the Calculated box: [LINEITEM. Selling Price] * 1. 25 When you run the form for each record in the table, the Selling Price field shows the current price, and the calculated field shows the price with theproposed increase. Example of calculating with an alpha string You can use the +operator to combine alpha strings. For example, suppose you want to create a field called Address that combinesthe values of the Street, City, State/Prov., and Zip/Postal Code fields for the Customer table. 1Create a form or report by using the Customer table in the data model. See Creating data models on page 171. 2In the Design Layout dialog box, choose Blank style. 3In the Design Window, use the T able Frame tool to place a table frame with three columns. 4Select the first field in the table frame (click three times to get to thefield), then right-click the frame and click Define Field. 5In the Define Field Object dialog box, choose Customer No from the Customer list box. 6Repeat step 4 with the second field in the table frame and choose Name. 7Repeat step 4 with the third field in the table frame and click Define Field;in the Define Field Object dialog box, type the following calculation: [CUSTOMER. Street]+fif[CUSTOMER. City] + f, f +[CUSTOMER. State/Prov]+fif[CUSTOMER. Zip/Postal Code] The+sign appends one string to the end of another. (You must type within quotation marks the spaces and commas you want insertedbetween fields. ) 8Click OK. In the Design Window, Paradox displays the word formula in the calculated field object. 418 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
9T ype the word Address as the calculated fields label. When you run the form, Paradox combines the values from the four fields for each record of the table and inserts spaces and commas where youplaced them in the calculated expression. Number methods in calculated fields Most of the number type methods, or procedures, also work in a calculatedfield. You can use number methods to do such things as round numbers invarious ways, derive a fractional part of a number value, find the higher oftwo values, ensure integer answers from calculations, or find the differencesbetween dates and times. For a complete listing of number methods, see Number methods in the online Object PAL Reference. Paradox recognizes methods in calculated fields such as Round, Long Int, Fraction, and Max. Paradox also recognizes cos, sin, tan, acos, asin, and atan,which only deal with angles in radians. Rounding a value You can choose to round a value to a specific number of decimal places or tothe nearest whole number. To round a value to a specific number of decimal places 1Open a form or report in the Design Window. 2Right-click the field, click Define Field. 3Enable the Calculated check box. 4T ype the following expression in the Calculated box: round([fieldname],# of digits accuracy) Example round([ORDERS. Total Invoice],1) If the value in T otal Invoice is $555. 94, $555. 90 is returned. To round a value to the nearest whole number 1Open a form or report in the Design Window. 2Right-click the field and click Define Field. 3Enable the Calculated check box in the Define Field Object dialog box. 4T ype the following expression in the Calculated box: round([fieldname]),# of digits accuracy) Working with design objects 419 | 292806769-Paradox-9-Eng.pdf |
Example round([Orders. Total Invoice],0) If the value in T otal Invoice is $555. 67, $556. 00 is returned. A value of $555. 45 returns $555. 00. Altering the appearance of a value You can set a field to display only a truncated whole number instead of adecimal, or you can set a field to display only the portion of a value thatfollows the decimal. To format a decimal value as a whole number 1Open a form or report in the Design Window. 2Right-click the field, click Define Field. 3Enable the Calculated check box. 4. T ype the following expression in the Calculated box: Long Int([fieldname]) Example Long Int([ORDERS. Total Invoice]) A value of $555. 23 returns $555, as does $555. 95. To derive a fractional part of a numeric value 1Open the Design Window of a form or report, right-click the field and click Define Field. 2Enable the Calculated check box. 3. T ype the following expression in the Calculated box: fraction([fieldname]) Example fraction([ORDERS. Total Invoice]) A value of $555. 23 returns 0. 23. Finding the higher or lower of two values You can program a calculated field to return the maximum or minimum valueof two fields. 420 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
To find the higher of two values 1Open a form or report in the Design Window. 2Right-click the field and click Define Field. 3Enable the Calculated check box. 4T ype one of the following expressions in the Calculated box: max(value1, value2) min(value1, value2) Example max([ORDERS. Total Invoice], [ORDERS. Amount Paid]) Unless the amount has been paid in full, this will always return the value in T otal Invoice. Date and time calculations Paradox allows you to perform calculations with dates just as you wouldperform calculations with any other numbers. You can use a calculated fieldto determine the difference between dates; this allows you to modify a largeform or report so that it contains only specific information. Finding the difference between two dates or times You can find the difference between any two dates or times so long as theyare represented in the same format. To find the difference, in days, between two dates 1Open a form or report in the Design Window, right-click the field and click Define Field. 2Enable the Calculated check box. 3T ype one of the following expressions in the Calculated box: number(date1-date2) This assumes date1 and date2 are field objects of the same type. For example, if date1 is 5/10/95 and date2 is 5/5/95, this example returns 5. 00. number(date(date1)-date(date2)) Working with design objects 421 | 292806769-Paradox-9-Eng.pdf |
This example assumes date1 and date2 are strings that represent the appropriate date format. For example, number(date(fi5/10/95")-date(fl5/5/95" This example also returns 5. 00. To find the difference between two times 1Open a form or report in the Design Window, right-click the field andchoose Define Field. 2Enable the Calculated check box. 3T ype the following expression in the Calculated box: format(fi TO(% Hours,%M Minutes)fl time1-time2) This example assumes that time1 and time2 are two fields that have timevalues in the appropriate format (HH:MM:SS am/pm). For example, if time1 is 5:25:00 pm and time2 is 1:15:00 pm, this example returns an answer of 4 hours, 10 minutes. Calculating a date based on the current date You can establish a field that will calculate a date based on the current date. For example, in August you want to print a list of transactions that is currentup to the last day of the prior month (July 31). In the report header, you wantthe title to read Transactions as of 7/31/97. To establish a field that will calculate a date based on the current date 1Open a form or report in the Design Window, right-click the field and click Define Field. 2Enable the Calculated check box. 3T ype the following expression in the Calculated box: today()-day(today()) T oday() is todays date, and day(today()) is the number of days since thebeginning of the month. When you subtract the number of days since thebeginning of the month from todays date, the last day of the prior month isreturned. 422 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
Calculated fields and printing Calculated fields increase your printing options. They allow you to control page numbering, capitalization and fields printed. You can also print theformula in a calculated field. Controlling page numbering with a calculated field You can start the numbering of the pages on a report at a value other than 1. For example, if you want the first page to have a page number value of 10,and the number to increase by one for each following page, perform thefollowing steps. To control page numbering with a calculated field 1Open a report in the Design Window. 2Place the field object in the page header or footer band. 3Right-click the field, click Define Field. 4Choose Page Number from the Special Field list. 5Right-click the edit region, click Properties. 6Click the Font page, set the font color to white (or whatever color thepage background is) to make the field invisible. 7Create a new field in the page header or footer band where you want thepage number to appear. This is the actual Page Number field that will be displayed. 8Right-click the new field, click Define Field. 9In the Define Field Object dialog box, enable the Calculated check box, and type the following expression in the Calculated box: Page_number. value + 9 Page_number is the default object name given to the Page Number fieldyou just created. 10Change the label on the new calculated field to read Page, or whateveryou would like. Using a calculated field to print only fields containing data You can vary what a field displays based on whether or not another field isblank. Working with design objects423 | 292806769-Paradox-9-Eng.pdf |
To prevent blank fields from printing Create a calculated field, and type in the following formula: iif(is Blank(fieldname), Value If True, Value If False) If (fieldname) contains no value, Value If True is used. Otherwise, Value If False is used. For Number, Short Number, and Currency fields, is Blank always returns a FALSE value if Treat Blank Fields As Zero is enabled on the Databasepage of the Preferences dialog box (Edit menu). Using a calculated field to capitalize fields when printing You can capitalize certain fields and records from the database when you printa report. To print the Name field as all capital letters 1Using the sample Customer file as an example, place a Name field with the Field tool. 2Right-click the field click Define Field. 3Enable the Calculated check box and type in the following expression in the Calculated box: Upper([CUSTOMER. Name]) format (fi CCfl,[CUSTOMER. Name This calculation takes the Name field and converts each word to have an initial capital letter; for example, sight diver or SIGHT DIVER to Sight Diver. The Name field does not need to be in the report. If you want to convert all names to lowercase, replace upper in theabove calculation with lower. A calculation to return an initial capital letter on the name can be done likethis: 424 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
Printing a calculation formula When you define a field as a calculated field, the formula becomes an Object PAL source. This means that the formula prints with the other Object PAL methods that are connected to the document. You can print justthe formulas for the calculated fields, or all the Object PAL code (for a formonly). To print only the formulas of calculated fields in a form 1Open the Design Window of a form or report, click View, Document Source to create a temporary report that lists all the Object PAL code inthat report. This report is based on a temporary table called PAL$SRC. DB. 2Click View, Design Report. 3Click Format, Filter. 4In the Method Name text box, type calc Field, then click OK. 5Click File, Print to print the temporary report. To print all the formulas of calculated fields in a report 1Click File, Open, Report. 2Enable the Open As A Form check box. 3Click the Edit The Form Design button. 4Choose the appropriate report from the Look In list, and then click Open. 5Click View, Design Form. 6From the Form Design Window, click View, Document Source to create atemporary report that lists all the Object PAL code in that report. Thisreport is based on a temporary table called PAL$SRC. DB. 7Click File, Print to print the temporary report. Graphic objects You can place graphic images in a form or report by putting a graphic objectin the document, and then inserting the graphic inside the graphic object. Youcan paste a graphic from the Windows Clipboard, or paste the image from a. BMP,. PCX,. TIF,. GIF,. EPS, and. JPG file. Working with design objects 425 | 292806769-Paradox-9-Eng.pdf |
Using graphics Although Paradox allows you to do some basic manipulation of graphics, it is best if you make major changes to your graphics in the server application. Paradox will allow you to size, move, copy, and crop a graphic that you placeon a form or report. See the Object property reference in the online Help for more information about graphics properties. Placing a graphic on a form or report Paradox uses frames to contain all graphics. T o place a graphic on a form orreport, first create the frame, and then insert the graphic. To make a graphic frame 1Click the Graphic tool. 2Do one of the following: to create a graphic frame at its default size click the area of the form or report where you want to place the graphic. to create a graphic frame of any size click the area of the form orreport where you want to place the graphic and drag to size the object. 3If you release the mouse button and the frame is not the desired size orshape, click and drag any of the eight handles that surround the object. The words Undefined Graphic appear in the graphic object. To place a graphic in the frame Right-click one of the following:In the Design Window, right-click the graphic frame and click Paste to place the contents of the Clipboard in the graphic frame. (If the Clipboard is empty, Paste is dimmed. ) In the Design Window, right-click the graphic frame and click Paste From to place a file in the graphic frame. The Paste From Graphic File dialog box opens. 426 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
When you define a graphic object, Paradox resizes it to fit the contents of its frame and checks its Size T o Fit property. You must disable thisproperty before you can resize the graphic object. For more informationabout the Size T o Fit property, see the Object property reference in theonline Help. Moving a graphic Click inside a graphics frame to move the graphic within the container. T omove the graphic as a whole, you must select both the graphic and the frame. To move a graphic 1In the Design Window, click outside the graphic object. 2Click the frame of the graphic until the handles appear around thecontainer. 3Drag the object to a new place. 4T o move the graphic within the container, click the container a secondtime to activate the graphic. The handles disappear, but you still seeshadows on the rulers and the pointer looks like a hand. Drag the graphicto a new location within the container. To place a graphic on a button 1Use the Graphic tool to place a graphic object on the button. 2Right-click the button, click Properties. 3Click the Design page. 4Enable the Contain Objects check box. Copying a graphic to a file without using Export You can save a graphic to any file using the Copy to function. To copy a graphic to a file without using Export 1Click the graphic object. 2Click Edit, Copy T o. 3In the Copy T o Graphic File dialog box, type a file name, including thepath if necessary, in the New File Name box. Working with design objects427 | 292806769-Paradox-9-Eng.pdf |
Resizing a graphic or OLE object on a report When you place a graphic or OLE (Object Linking and Embedding) object in the Report Design Window, the container you place automatically expands tofit the size of the contents. By default, Paradox enables the Size T o Fitproperty. If a graphic is too big for its frame, you can move the graphic withinits frame or crop the graphic to the size and area you want. To resize a graphic or OLE object 1Open the Design Window of a form or report, right-click the OLE objectand click Properties. 2On the Design page of the Properties dialog box, disable the Size T o Fitcheck box. 3Click OK to return to the Report Design Window. 4Click the graphic to select it. 5Drag the handles to resize the graphic. To crop a graphic 1Open the Design Window of a form or report, right-click the container andclick Properties. 2On the Design page of the Properties dialog box, disable the Size T o Fitcheck box. 3Click OK to return to the Design Window. 4Drag one of the sizing handles of the container until it is smaller than thegraphic it contains. 5Click the graphic to select it. The pointer changes to an open hand. 6Drag the graphic around in the container to the position you want withinthe frame. 7Resize the container if necessary. For more information about the Size T o Fit property, see the Objectproperty reference in the online Help. 428 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
Understanding raster operations When you define a graphic object, you identify a source graphic (a file) to be placed in a destination (your computers screen). Most often, Paradoxassumes you want an unchanged copy of the source placed on the screen. Suppose, however, you want the source graphic and the screen to interact. You might want to make the source graphic transparent, to have the color ofthe page shows through, or you might want to invert the color of the sourcegraphic. Raster operations define how Paradox combines the source graphic with the destination inverting, combining, including, or excluding colors to yourspecifications. Paradox uses the Boolean AND, OR, and XOR comparisonoperators to combine individual pixels of color during raster operations. The following table briefly describes each raster operation: Raster operation Onscreen result Source Copy Copy an unchanged source graphic to the destination. Source Paint Combine the source graphic and the destination using the Boolean OR operator. Source And Combine the source graphic and the destination using the Boolean ANDoperator. Source Invert Combine the source graphic and the destination using the Boolean XORoperator. Source Erase Invert the destination and combine it with the source graphic using the Boolean AND operator. Not Source Copy Invert the source graphic and copy it to the destination. Not Source Erase Combine the source graphic and the destination using the Boolean ORoperator. Merge Paint Invert the source graphic and combine it with the destination using the Boolean OR operator. Demonstration of raster operations T o see the effects of these raster operations, open RASTEROP. FSL in your SAMPLE folder (or wherever you installed the sample applications). Creating a mask for a graphic Suppose your forms page is colored, and you want to place a graphic objecton the page. If the background of the graphic object doesnt match the colorof the page, the borders of the graphic will show. Use a mask to make some Working with design objects 429 | 292806769-Paradox-9-Eng.pdf |
areas of the graphic transparent. Masks allow the pages color to show through it. For example, suppose your forms page is yellow and that you want to place an oval-shaped graphic object on the page. Unless the background of the ovalgraphic and the yellow of the page match exactly, the borders of the graphicobject will be visible. To create the mask 1Make a copy of the source graphic. Call it MASK. BMP. 2In a graphics application, such as Corel PHOTO-PAINT, modify MASK. BMP to make the parts you want to be transparent black and allother parts white. 3In the Form Design Window, place a graphic object, then right-click thegraphic object and click Paste From. 4Choose MASK. BMP from the File Name list to insert this graphic into thegraphic frame. 5Right-click the graphic object and click Properties. Choose Source Paintfrom the Raster Operation box on the Raster Operation page. 6Place another graphic object. Right-click the object and click Paste From. In the Paste From Graphic File dialog box, select your original graphic. 7Right-click the original graphic object. In the Properties dialog box,choose the Source And Raster operation from the Raster Operation boxon the Raster Operation page. 8Select both graphic objects by clicking each object while you hold down SHIFT. 9Right-click one of the objects and click Properties. In the Frame page,select the top left style in the Frame Style palette to remove the framesfrom the graphic objects. 10With both graphic objects still selected, click Format, Alignment, Align Left. Then click Format, Align, Align T op. Finally, click Format, Group. When the original graphic and the mask are combined, the areas you want transparent allow the page color to show through. The order you place the graphics on the form determines the results,because it affects which bitmap is in front. If you place the original graphicon the form before the mask, you must select the original and click Format, Order, Bring T o Front before you align the graphics. 430 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
To choose which raster operation you want to use The choices for raster operations are located in the properties dialog box. To choose a raster operation 1Select the graphic you wish to change. 2Right-click the graphic, select Properties. 3Click the Raster Operation page. 4Choose the raster operation you want to use from the Raster Operation list. See Raster Operation properties in the online Help for moreinformation on specific raster operations. Multi-record objects A multi-record object displays several records at a time by using a field layoutthat repeats a specified number of times horizontally and vertically on thepage. You can place fields in any pattern. You define the field layout for onerecord and then specify how many records across and down you want. The record object inside the multi-record object is a container for therecords. If you make the record object too small, Paradox will eliminatefields in the Define Multi-record Object dialog box (right-click menu) tomake the record fit the container. T o resize the records, select the masterrecord region and drag any of its selection handles. Placing a multi-record object on a form or report After you place a multi-record object, you can specify which fields display ineach record. Only the fields from a detail table can be displayed in amulti-record object. To place a multi-record object on a form or report 1In the Design Window, Click the Multi-record tool. 2Click to place the multi-record object at its default size, or click and dragto place the multi-record object and specify its size. Working with design objects431 | 292806769-Paradox-9-Eng.pdf |
3Click the record object inside the multi-record object. 4Resize the record object to make it large enough to contain all the fields you want to include in the record. To define a multi-record object 1In the Design Window, right-click the multi-record object and click Define Record. 2In the Define Multi-record Object dialog box, which displays the tablesbound to the document, choose the fields you want from the table list box(for example CUSTOMER. DB). If you make the record object too small, Paradox will eliminate fields inthe Define Multi-record Object dialog box to make the record fit thecontainer. Specifying the record and field layout of a multi-record object You can specify how many records to repeat across and down in amulti-record object. You can also specify whether you want fields to bedisplayed in columns or rows. To specify the record layout of a multi-record object 1In the Design Window, right-click the multi-record object and click Properties. 2Click the Record Layout page to bring it to the front. 3Specify the layout by: T yping the number of records to repeat across and down the page in the Number boxes. Setting the vertical and horizontal separation between the records bytyping the appropriate numbers in the Separation boxes; Paradox usesthe unit of measurement (inches or centimeters) you specify in the Grid Settings. Establishing the order in which the records appear by enabling theappropriate Fill Order button. To specify the field layout of a multi-record object 1In the Design Window, right-click the multi-record object and click Define Record. 432 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
2In the Define Multi-record Object dialog box, choose the field you want to display in the object from the tables list box. 3Click OK to return to the form or report. 4Right-click the multi-record object and click Field Layout. 5In the Layout Multi-record Object dialog box, enable one or more of thefollowing: By Column button displays fields by columns within the record By Row button displays fields by rows within the record Label Fields check box displays field labels within the record On the Fields page, select fields to be included in the record and use the arrow buttons to set the order of the fields. When you specify the layout of a multi-record object in a report, thenumber of times records repeat can be affected by the Show All Recordsand Delete When Empty properties on the Run Time page of the Properties dialog box. Resizing records in a multi-record object You can expand or contract individual records in a multi-record object whenyou print or preview reports. This means that the multi-record object doesnot display the records in a fixed-size grid. If you use the Variable Height(Columnar) property, you can usually fit more records on a single page thanyou can without the Variable Height (Columnar) property. To resize records in a multi-record object 1Select the master record region of a multi-record object. 2Drag any of its selection handles. Paradox resizes the gray repeating regions along with the master record region. To expand or contract records in a multi-record object 1In the Design Window of a form or report, right-click the multi-recordobject and click Properties. 2On the Record Layout page of the Properties dialog box, enable the T op-Down Then Left-Right button. Working with design objects 433 | 292806769-Paradox-9-Eng.pdf |
3If you are creating a report, enable the Variable Height (Columnar) check box. Columnar is not available unless you first select the T op-Down, Then Left-Right setting. The Columnar property is available only in reports. The record object inside the multi-record object is a container for therecords. If you make the record object too small, Paradox will eliminatefields in the Define Multi-record Object dialog box to make the record fitthe container. The record object inside the multi-record object is a container for therecords. If you make the record object too small, Paradox will eliminatefields in the Define Multi-record Object dialog box to make the record fitthe container. Showing all records and columns in multi-record objects When you run a form or report, Paradox can expand a multi-record object tocreate as many pages as necessary to display all records or columns. To show all records and columns 1In a Design Window, right-click a multi-record object, click Properties. 2Click the Run Time page. 3Enable the Show All Records check box. For table objects, you can alsoenable the Show All Columns check box. If Show All Records is disabled, Paradox displays a fixed number ofrecords. Notebook objects Notebooks contain one or more pages. Each page has a tab that you can clickto display the page. You can use a notebook to replace multiple form pages. For example, you can place the information from each table in the forms datamodel on a different notebook page, rather than on multiple form pages. Thismakes viewing and editing data much more efficient because the you canclick a tab to display the page, rather than navigating through multiple pagesof the form. Notebooks are available only in forms, not in reports. 434 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
Working with notebook objects Each notebook page is a container for other objects. Any design object that can be placed on a form can be placed on a notebook page. You can even placea notebook object on a notebook page. Data objects on notebook pages You can place data objects on different notebook pages to make datamaintenance more efficient. For example, by using a data model that contains a one-to-many relationship, you might put the master-table records on the first notebook page, the firstdetail-table records on the second page, and the final detail-table records onthe third page. You could then select the first notebook page, cycle throughthe master records, and consult the details only when needed. Not only doesthis simplify the display, but it improves performance. Notebook properties You can change the properties for the notebook as a whole, or for individualpages. For example, you can place the tabs on the top or bottom of thenotebook and change the shape of the tab from square to angled. Individualpages can be colored, and each page can have a different color when it isactive than when it is inactive. You can make the entire notebook, orindividual pages, invisible at runtime. T wo table frames on different notebook pages cannot refer to the sametable in the data model. Placing a notebook on a form You use the Notebook tool to create notebooks on forms. A notebook cannotbe placed on a report. Working with design objects435 An example of anotebook object withbutton objects. Adding buttonobjects to thenotebook makesretrievinginformation moreefficient. | 292806769-Paradox-9-Eng.pdf |
To place a notebook on a form 1With a form open in the Design Window, click the Notebook tool on the Form Design T oolbar. 2Click the form to place a notebook at its default size, or click and drag toplace the notebook and specify its size. Selecting a notebook or a notebook page Notebooks conform to the conventions of the Select From Inside property. When that property is unchecked, the first click in the Design Windowselects the outermost object. Subsequent clicks select the next smallestlevel of containership. To select the entire notebook Click the notebook. (If you have already clicked once or twice on thenotebook, clear the selection by clicking on the form page outside thenotebook object. ) A double dotted line with sizing handles frames the notebook object. If you have difficulty selecting the entire notebook, make sure the Select From Inside check box on the Designer page of the Preferences dialog box(Edit menu) is disabled. To select a notebook page 1Click the notebook. 2Click a pages page to select the page. 3T o select a different page, click the pages page. Navigating notebook pages You can move throughout the notebook you have placed on your form in avariety of ways. 436 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
Using the mouse or keyboard Display a notebook page by clicking its tab. (In a Design Window or when running the form). Cycle through the objects by pressing TAB and SHIFT + TAB. Use thistechnique to move to any notebook page, or to any object on any notebookpage (Design Window only). Move through the notebook pages by pressing SHIFT + F3 (backward)and SHIFT + F4 (forward). (In a Design Window or when running theform. ) Using the right-click menu You can right-click the notebook to move through its pages. This is similar tomoving through the pages of a form. 1Select the entire notebook. 2Right-click the notebook, Click Page, Next to move to the page to the right of the current page. If the current page is on the right edge of the notebook, Paradox choosesthe left-most page on the row above the current page. Click Page, Previous to move to the page to the left of the currentpage. If the current page is on the left edge of the notebook, Paradoxchooses the right-most page on the row above the current page. Click Page, First to make the first page (the one created first) current. In notebooks with multiple rows that have been shifted around, thisindicates which page is first. Click Page, Last to make the last page you created current. Placing an object on a notebook page You can place any design object on a notebook page. You can even place anotebook object on a notebook page. To place an object on a notebook page 1Select a notebook page. 2Click an objects tool on the Form Design T oolbar. 3Drag within the confines of the notebook page to create the object. Working with design objects 437 | 292806769-Paradox-9-Eng.pdf |
T o modify the label on the tab, select the label text object, press F2, and start typing. The label grows to fit the text. Adding and removing notebook pages The default number of pages for a notebook is two. There are times whenyou will want to have more than two pages in your notebook, so Paradoxallows you to customize your notebook so that it has as many pages as youneed. Adding or deleting a notebook page By default, a notebook has two pages. A notebook must have at least onepage. To add a page 1Select the entire notebook. 2Right-click the notebook and choose Properties. 3On the General page, change the Number of pages to one more than thecurrent number. Paradox adds one page to the form at the end of the existing pages. To add multiple pages 1Select the entire notebook. 2Right-click the notebook, click Properties. 3On the General page of the Properties dialog box, type a number in the Number Of Pages dialog box. To delete a notebook page 1Select a notebook page. 2Click Edit, Delete. 438 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
You can control the number of tabs displayed and the number of rows that display them. For example, if you specify eight pages with four tabsacross, the notebook will have two rows with four tabs on each row. When you add rows, the tabs on any given row continue to remain on acommon row. If you select a tab from the back row, the entire back row oftabs moves to the front row with the selected page. T o display the tabs in one scrolling row, add a scroll bar as described inPlacing a scroll bar on a notebook on page 440. Rotating notebook pages You can move a selected notebook page to the last pages position. You canalso cut any page of the notebook and paste it to any other location. To rotate notebook pages 1Open the appropriate form in the Design Window, select the page youwant moved to the end of the notebook. 2Click off of the notebook then right-click the notebook and click Rotatepages. To copy and paste a notebook page 1Select a notebook page. 2Right-click the page and click Cut or Copy to place the page on the Clipboard. 3Select another notebook page. 4Right-click that page and click Paste. Paradox inserts the Clipboards notebook page after the active notebook page. You can also use the Cut, Copy, and Paste commands from the Edit menu. Changing the appearance of a notebook Although notebooks are somewhat fixed in appearance, you can change thesize of the notebook and its tabs so as to fit the contained objects better. Youcan also place a scroll bar on the notebook, allowing you to work with smallpages while still presenting all the fields you require. Working with design objects 439 | 292806769-Paradox-9-Eng.pdf |
Moving or resizing a notebook Notebook pages cannot be moved or resized separately from the notebook, but you can change the height of the tabs on the top or bottom of thenotebook. To move a notebook 1Select the entire notebook. 2Drag it to a new location. To resize a notebook 1Select the entire notebook. 2Drag one of the sizing handles to change the shape of the notebook. To change the tab height on a notebook 1Select the entire notebook so that a double dotted line with sizing handlesframes the notebook object. 2Drag one or more of the following: The center sizing handle nearest the tabs to change the height. The top center handle to resize the tabs on the top. The bottom center handle to resize the tabs on the bottom. If you reduce the height of the tabs, you may want to choose a smaller font size for the labels. Placing a scroll bar on a notebook When the tabs do not fit in the available space, you either use multiple rowsas discussed in Adding or deleting a notebook page on page 438 or you canuse one row and add a scroll bar so that you can display the tabs in onescrolling row. To add a scroll bar 1Select the entire notebook. 2Right-click the notebook, click Properties. 440 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
3On the General page of the Properties dialog box, enable the Scrolling Tabs check box. When the Scrolling Tabs check box is enabled, the notebook has one row of tabs. Those that do not fit are not visible. On the right side of thenotebook are left and right arrow buttons. Click a button to scroll the tabsleft or right. Hold down a button to scroll the tabs repeatedly. Scrolling does not change which page is active. You can scroll the tab forthe active page off screen and still view the active page. When you scrollto the desired tab, you must click the tab to make its page active. Active X and Native Windows Controls Active X controls and native Window controls are useful tools in enhancingcustom forms. They provide added functionality, such as adding a list box tohelp display items without taking up space or an Active X VCR control whichallows you to scroll through records. Active X Controls (OLE Control) You can embed Active X (OLE control) controls into Paradox forms. Active Xcontrols can be a complex miniature application such as a spreadsheet,Internet Web browser, communications package, or grid and graphingcontrols. T o interact with Active X controls at runtime, you can write Object PAL code to get and set properties, invoke methods, and handle events. T o interactwith an Active X control, you can refer to the UIObject name that hosts the Active X control directly or you can use the Ole Auto Object PAL type. The Ole Auto type lets you communicate with an OLE server and Active X control,and Native Window Controls, by translating Object PAL into OLE automationcalls. Each Active X control surface methods, properties, and/or events, which you can set and call when you design or run the form. Because Active X controlsare a separate application running as a subprocess of Paradox, you will findthe behavior different from normal Paradox UIObjects. Each Active X controlhas its own child window on the form and its own message queue. This givesthe Active X control its own event model, which is sometimes called the fireevent model. Active X controls are said to fire events; they are either notifications that something is about to happen (before event), is happening (do event), hasjust occurred (after event), or requests to determine if an impending action ispermissible (request event). Working with design objects 441 | 292806769-Paradox-9-Eng.pdf |
An Active X control application will often fire an event without asking first if it is acceptable to fire such an event. This is the way that the Active X controlspecification is written. You cannot use Object PAL to intercept events thatare going to an Active X control application (for example, trying to disable amouse Click on an Active X control). Because of this, Object PAL developerswill find that the Active X control model requires some adjustment. Native Window Controls Paradox surfaces five controls we call native window controls (NCW). Theseare created using property, method, and event specifications from OLEembedding. You can link them as a hybrid between traditional Paradoxcontrols (since these native Windows controls are built directly into Paradoxitself) and regular Active X controls (because they follow the specifications inmany areas). The Application Program Interface (API) for a Native Windows Control is directly ported from the Windows API. These controls are wrapped in an Active X container in Paradox; therefore, they behave just like an Active Xcontrol. The Active X wrapper governs its size, position, and frame style, andit provides its hooks to Object PAL. NWCs use the same technique as regular Active X controls (Ole Auto type) to set and get properties and to invokemethods. The NWC properties, methods, and events are visible in the Object Explorer, but cannot be set there. Their properties must be manipulated via Object PAL or interactively using the Object Explorer. Native Windowscontrols do not need to be installed, registered, or added to the toolbar. Theycome pre installed with Paradox. For all practical purposes, a native Windows control looks like an Active X control to the Paradox form and language system. The same programmingconcepts that apply to Active X controls apply to native Windows controls. The only difference is that NWCs do not use OLE embedding or support anykind of user interface negotiation. Active X control toolbar Both Active X and native Window controls are found in the Active X controltoolbar. List Box a native Window control that allows single or multiple selections. Combo Box a native Window control with and edit region and a list box. Spin Box a native Window control with Up and Down buttons to increase or decrease thevalue. 442 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
Progress Bar a native Window control used to track the completeness of a process. Trackbar a native Window control that allows you to drag a pointer along a track to set numerical values. Paradoxfi VCR Control an Active X control used to move through records in forms. Using Active Xs and NWCs in Design mode Active X controls are available from third-party vendors, and these vendors provide property pages for you to set properties during form design. Thisallows you to set the initial state of the Active X applications. Before you can use a control, you must first register the control, then add the control to the Active X Control toolbar. You can use Active X controls and Native Windows Controls the same way in forms. You place the control on the form, right-click the control to change itsproperties, and add new methods or events by using the Object Explorer. For information on using and modifying your specific Active X control, see the documentation from the Active X control manufacturer. Active Xs in multi-record objects, table frames, and crosstabs Active X Controls and Native Windows Controls do not clone in recordobjects or crosstab cells. This means that these controls will not embed ineither object. If you create or move an Active X control inside a multi-recordobject or a tableframe, it will not be a child of the interior (repeating) recordobject. The same is true for crosstabs the Active X control cannot be achild of a (repeating) cell object. Active X controls will not repetitively cloneinto multiple repeating record groups. For more information on Active X and Native Window Controls, see the Object PAL reference section in the online Help. Active X control event types Active X controls have events that are different from Paradox events. Eachcontrol comes with a primary event set that follows a basic convention forwhat types of events are fired and how the event parameters are packaged. Ifthe default event type for the control can be canceled, you can modify theevent parameters to make the control behave the way you want. Working with design objects 443 | 292806769-Paradox-9-Eng.pdf |
Active X controls can issue events, such as click events. The names of the events issued by a control are chosen by the creator of the control. You cansee the names of the events in the tabbed pane of the Object Explorer on the Events page. All methods, events, and properties that come with a controlare displayed in red text in the Object Explorer and are preceded by a roundbutton. These methods, events, and properties will also be listed in thedocumentation for the control. Controls usually follow a naming convention for their events. For example, Do events begin with the word Do, and Request events begin with the word Request. Because After events are the most common, any event that doesnot begin with one of the other type names is assumed to be an After event. Active X control events fall into four basic categories: Request events, Before events, After events, and Do events. Of the four types of controls, Before and After events cannot be canceled. Request events A control fires a Request event to determine if an impending action ispermissible and allows the user to cancel an action. Request events can becanceled. Before events Before events are notifications that something is about to happen. They arefired before an action occurs to allow the completion of actions that areneeded before the event fires. Before events cannot be canceled. Do events Do events are notifications that something is happening. They are fired toallow the user to replace or supplement the controls default behavior. Doevents can be canceled. Do events usually begin with the word Do, and thelast parameter is the cancel flag. After events After events are notifications that something has just occurred. They arefired after an action occurs to allow response to the action. After eventscannot be canceled. Most real controls only do the After event. For example, a typical control issues only one event for a click. The event would be called Click, comesafter the click has happened, and cannot be canceled. Some controls will issue a series of related events. For example, for the Click event, you could see the following events: 444 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
Request Click (Request event) Before Click (Before event) Do Click (Do event) Click (After event) Any particular control might not follow these guidelines. For example, it might only expose the Do Click or the Click event. For information about using and modifying your Active X controls, see the documentation from the Active X control manufacturer. Ambient properties Ambient properties are properties a control adopts from its container. Forexample, an Active X control placed on a yellow form obtains informationabout the forms properties, determines that it can use the yellowbackground color, and incorporates the forms background color into itsproperties, along with any other properties it can use, such as foregroundcolor and text font. Ambient properties can be set for each control, but Active X controls are not required to use these properties. Therefore, not all controls will respond tochanges in these ambient properties. Ambient properties give information about the state of the container around the control. This can be the entire container (such as the background color)or the immediate area surrounding the control. For example, a control can beinserted into a text document that will have different sized fonts. Theambient font property of the control has different values, depending on wherethe control is placed. Displaying the Active X Control toolbar Active X and Native Windows Controls are both found in Active X Controltoolbar in the Form Design Window. To display the Active X Control toolbar Do one of the following: Click View, T oolbars and enable the Active X Control check box. Right-click the background in the toolbar area, and enable the Add Active X Control option. Working with design objects445 | 292806769-Paradox-9-Eng.pdf |
Placing a control on a form You can easily place any of the controls from the Active X Control toolbar on your form, just as you would any other design object. To place a control on a form 1Click View, T oolbars and select the Active X Control toolbar. 2Click one of the tools on the Active X Control toolbar. 3Click in the Form Design Window to place the control at its default size,or click and drag to place the control and specify its size. 4Right-click the object to add a method or event to the object by choosingthe Object Explorer or to change its properties by choosing Properties. Programming the Paradox VCR Control The Paradox VCR control is an additional Active X control supplied by Paradox. You can attach it to your forms and use it as a tool for navigation. You must add Object PAL code to each button to define its action. To program the Paradox VCR control 1In a Form Design Window, click the Paradox VCR control on the Active X toolbar. 2On a Form, click and drag to position the Paradox VCR control. 3Select the Paradox VCR control and click T ools, Object Explorer. 4On the Events tab, double-click any of the following events and addcustom code: Back Fast Back Fast Forward First Record Forward Last Record For more information on defining the custom code for each button see Paradox VCR control in the online Help. 446 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
Registering an Active X control You need to add the Active X control to the T oolbar before you can use it in a form. To register an Active X control 1Install the control on your computer according to the directions from the Active X manufacturer. 2Start Paradox. 3Click T ools, Register Active X Control. 4In the Register Active X Control dialog box, locate and then double-clickthe appropriate file. This registers the control and registers Paradox as an Active X automation server. To add a control to the Active X Control toolbar from the Form Design Window Right-click an icon on the Active X Control toolbar, click Add Active X Control, and then select the appropriate tool. To remove a control from the Toolbar 1Open the Design Window of a form or report. 2Right-click an icon on the Active X Control toolbar, click Remove Active XControl. 3Select the tool you want to remove, click Remove. Editing events on an Active X control You can edit the manner in which Paradox responds to an event controlled byan Active X control by editing the events code in the Object Explorer. To edit events on an Active X control 1Place an Active X control on a form. 2Right-click the object, choose Object Explorer. (Make sure the tabbedpane is displayed with View, Tabbed Pane on the Object Explorer menu. ) 3Double-click the event on the Events page. 4In the Editor window that opens, edit the method. Working with design objects447 | 292806769-Paradox-9-Eng.pdf |
Table frame objects If your form or report design includes a table, a table frame that represents the table will be visible. A table frame looks like its source table, but a tableframe is not a table. It is a composite object that consists of: columns that represent fields rows (the top row represents all records) text objects that contain labels for the fields field objects that represent data from the source table in the first row below the header Paradox automatically places a table frame on the design if you either choosea tabular layout in the Design Layout dialog box or create a multi-table formor report composed of a one-to-many relationship. Working with Table frame objects When creating a blank form or report, you can create a table frame and addonly the fields you want to display. You must have at least one table in yourdata model in order to define the columns of your table. By setting theproperties of your report, you can choose how many columns and rows youwant displayed in Run mode. Placing a table frame on a form or report You might want to place a table frame on a design to display additional tablesin a form or report. To place a table frame on a form or report 1With the appropriate form or report open in the Design Window, click the T able Frame tool. 2Click the form or report to place the table frame at its default size, or click and drag to place the table frame and specify its size. Paradox creates a table grid with labels and undefined fields. This is the table frame. If you specified a table in the documents data model, the new table framecan either be linked to or independent of that table. 448 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
Defining a table frame When you define a table frame, you specify the table to use and which fields to include. Use the Table Frame tool to place linked or unlinked tables in aform or report. Paradox creates an undefined table frame with a header that contains column labels that say Label and a record that contains undefined fields. To define a table frame 1Right-click the table frame and click Define Table. 2In the Define Table Object dialog box, click the table you want from thedata model. 3Choose the fields you want to display from the appropriate tables list box(for example, CUSTOMER. DB). The fields and labels in the table are replaced by fields and labels that are appropriate to the chosen definition. Any contained objects, properties, or Object PAL code are lost. If the Size T o Fit property is enabled on the Design page of the Propertiesdialog box, the table frame tries to size to the width required to show allcolumns. If it cannot, or if Size T o Fit is not enabled, the missing columnsare still there. You can view them by placing a horizontal scroll bar on thetable frame. You can also define a table frame by either right-clicking the master recordand clicking Define Record or defining individual field objects. If you want to delete or insert a column, simply right-click either on thecolumn you want deleted, or the column to the right of where you want toinsert the new column, and select Delete or Insert column. Showing all records and columns in table frames When you run a report, Paradox can expand a table frame object to create asmany pages as necessary to display all records or columns. To show all records and columns 1Open the Design Window of a form or report, right-click a table frameobject and click Properties. Working with design objects449 | 292806769-Paradox-9-Eng.pdf |
2Click the Run Time page. 3Enable Show All Records In One Object and the Show All Columns check boxes. If Show All Records By duplicating object is enabled, Paradox displays afixed number of records. Modifying table frames You can customize the properties of a table frame in a form or a report in thefollowing ways: Right-click the field objects and click Properties to change properties. Right-click a record (row) as a whole and click Properties to change its properties. Right-click the table frame and click Properties to change any of itsproperties. Right-click the header and click Properties to change its properties. Because the table frame you place in a design is not the actual table, propertychanges and table frame restructuring do not affect the actual table. Onlychanges made to the data appear in the table itself. Changing the position and appearance of fields You can move a field in a table frame object without removing the column towhich the field belongs. To move a field Click and drag it to a new position or move a field out of the table area bydragging it out. Changing the appearance of columns and rows in a table You can change the size, position, name and existence of any column or rowin the table frame. To change the appearance of rows in a table Drag the horizontal grid line under any field object. This resizes the row height for all the rows in the table frame. 450 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
To change the appearance of columns in a table Resize a column by selecting the table frame and dragging the right grid line of the column. T o resize all columns to the minimum width, right-click the table frameobject and choose Minimize Columns. To remove a column in a table Remove a column by selecting it and pressing DELETE. You can also delete a column by resizing it to nothing. Drag the vertical grid line at the right of the column to the left. When you reach theminimum column width, the grid line changes to a dotted outline. Releasethe mouse button to delete the column. To add a column in a table Add a column by selecting a column and pressing INSERT. The newcolumn appears to the left of the selected column. To move a column Move a column by selecting the header for the column and dragging it to anew position. You can also select the whole column and drag it to the new location. To change a columns name Select a column name (Paradox displays an insertion point) then type your change. Changing header appearance and position When a group breaks across several pages, you can repeat the group headerat the top of each page. The Repeat Header property is not available for atable frame that has detached headers. To resize header areas Drag the grid lines under the field labels. The header labels must remain in alignment with the columns of the table; therefore, dragging either the header or the body of the table sidewayscauses both the header and the body of the table to move. Working with design objects451 | 292806769-Paradox-9-Eng.pdf |
To repeat a table header in a report 1Select the appropriate table frame. 2Right-click the table frame and choose Properties. 3On the General Page of the Properties dialog box, enable the Repeat Header check box. To detach a header 1Select the appropriate table frame. 2Right-click the frame and choose Properties. 3On the General Page of the Properties dialog box, disable the Attached Header check box. You can now move the header to another location. In a report, you can move the header to another band. Specifying grid style for a table frame You can change the grids style and color and also display a record dividerbetween each row of data. When you enable the Record Divider check box,Paradox does not change the table frame image in the Design Window thatimage already has visible record dividers. The difference will appear whenyou run the form or print the report. Without record dividers, horizontal linesdo not appear between the records in the table frame. To specify grid style for a table frame 1Right-click the table frame and click Properties. 2Click the Grid page 3Set grid properties as appropriate. Adding data and design objects to a table frame You can add a regular, special, summary, or calculated field by placing anddefining a new field object. These changes do not restructure the table itself. They change only the view of the table in this table frame on this document. To change the definition of a field object Right-click the field, and click Define Field. 452 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
To add design objects and data elements such as other tables, charts, or crosstabs to a table 1Select the container for the object you want to add. 2Select the design tool for the object you want to add. 3Draw the object so that it is contained within the boundaries of the container. If you draw the object so that it extends beyond the boundaries of the container, it will only appear once on the form or report, rather than inevery row of the selected column. Combining (stacking) fields in a column You can place the data from two columns into one column by stacking thecolumns. You do this by moving field objects from one column into anothercolumn, just as you would move any other design object. You can also addnew field objects to an existing column. To stack field objects in the same column 1Resize the record area of the column to adjust its width and height. 2Do one of the following: Drag existing field objects from other columns into the desired column. Create new field objects within the column. When you stack fields in a column, the document may be more readable if you right-click the table, choose Properties, and enable the Record Divider check box on the Grid page. Text objects T ext objects in forms and reports fill a variety of needs. Use them to addlabels, provide instructions, or create titles. You can change the formatting,alignment, color, font, and wrapping of text objects. T ext objects can beplaced separately on a form using the T ext tool; or, they can appearautomatically as part of another design object, for example as a label in a fieldor as a heading in a table frame. Working with design objects 453 | 292806769-Paradox-9-Eng.pdf |
Placing a text object on a form or report You create a text object and type text inside the objects frame. T ext objects in forms and reports grow and shrink to fit text differently, depending on howyou create them. To define the frame size before typing 1Open a form or report in the Design Window, click the T ext tool. 2Click one of the following: The form or report where you want to place the text object at its default size. T o create a text object of any size, click the form or report where youwant to place the text object and drag to size the object. 3T ype the text. As you type, Paradox automatically wraps the text at the right border of the frame. When you reach the bottom of the frame, Paradox scrolls thetext upward so you can view the text you are typing. To start typing without defining the frame size 1Open a form or report in the Design Window, click the T ext tool. 2Click the form or report and begin typing without dragging to create aframe. Paradox creates a single-row text object that expands to the right until you press ENTER. The insertion point then moves to a new line. As youcontinue typing, the text wraps automatically at the right border (whichyou defined by pressing ENTER) and continues to expand downward untilyou finish typing and click somewhere else. If you delete text, the textobject shrinks in height to leave no empty space. The type of text object where the Fixed Size button is enabled on the General page of the Properties dialog box does not grow or shrink basedon the amount of text you type. You can manually resize by dragging theframe. 454 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
The type of text object where the Fit T ext button is enabled on the General page of the Properties dialog box grows or shrinks to fit theamount of text you type. The Word Wrap property for this type of textobject turns on automatically when you press ENTER. For moreinformation on properties, see the Object property reference in the online Help. When Word Wrap is enabled on the T ext page of the Properties dialog box,you can only resize the object horizontally. When Word Wrap is disabled,you cannot resize the text object. Using word wrap You can specify Word Wrap for field and text objects in a form or reportdesign. This feature wraps text automatically at the objects right border. Word wrap works differently for fields and text. Fields Word Wrap displays the contents of a field in more than one line when theyexceed the width of the field object. Word Wrap is not available for graphicand Object Linking and Embedding (OLE) fields. Text Word Wrap creates a new line of text at the frame of the text object. If Word Wrap is disabled, only one line of text can be displayed in the text object. Pressing ENTER does not create a new line. To enable word wrap 1Right-click the field or text object in a Form Design or Report Design Window and click Properties. 2Click the T ext page of the T ext Properties dialog box. 3Enable the Word Wrap check box. Changing text in a text object You can only enter and edit text in text objects in the Design Window. Whenyou run a form or preview a report, you can see text objects, but you cannotedit them. To change text in a text object 1Click the text object. Working with design objects 455 | 292806769-Paradox-9-Eng.pdf |
2Click the text object again to place the insertion point in the text object. 3T ype the text. 4After editing the text, do one of the following: Press ESC or TAB. Click outside the text object. Click another tool from the T oolbar, or click the Selection Arrow. If the Fit T ext property for this object is enabled (on the General Page of the Properties dialog box) and the object contains no text, Paradox deletesthe text object from your form or report. To edit text using the keyboard 1Press TAB to select the text object. 2Press F2. 3Use the arrow keys to move the insertion point to the place in the textyou want to edit. For more information on properties, see the Object property reference inthe online Help. Inserting fields in text You can insert fields within a text object in a form or report. This isespecially useful in a report, because you can use this feature like a mailmerge. To insert fields in text 1Open a form or report in the Design Window. 2Click the text object. 3Click inside the text object again so that the cursor appears inside theobject. 4Begin typing. 5Press F5 to insert an unlabeled, undefined field. 456 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
6Define this field as you would any other. When you run the form or report, Paradox extracts the text value of the field and wraps it in its position within the line of text. The text followingthe field value is correctly spaced. Example of inserting fields in a text object Suppose you want to include the following line in a report using the Customer and Orders tables, with a Customer to Orders data model and ablank design layout. You have placed X orders for a total of $X since you began doing businesswith us. To create the line 1Using the Field tool, place a field object in the record band of the report. Define it as CUSTOMER. DB:Customer No. 2Place another field object in the record band, only this time define the fieldas CUSTOMER. DB:Name. 3Place a text object in the record band of the report. 4In the text object, do the following: T ype You have placed and then press SPACEBAR to place a space between the text and the field value. Press F5 to insert an undefined field. Press SPACEBAR again to place a space after the field value, then typeorders for a total of. Press F5 to insert another undefined field. T ype, since you began doing business with us. 5Select the first field object in the text object, then right-click the fieldobject and define it as Count(ORDERS. Order No). 6Select the second field object in the text object, then right-click the fieldobject and define it as Sum(ORDERS. T otal Invoice). 7When you run the report, Paradox pushes or pulls the text surroundingthe field objects to adjust for the size of the field values. Working with design objects 457 | 292806769-Paradox-9-Eng.pdf |
If the text objects Line Squeeze property is enabled on the Run Time page of the Preferences page (Edit menu), and if there is only one fieldembedded in a line of text, and the field value is blank, Paradox blanks outthe entire line of text that contains the blank field. A line of text isconsidered to be anything between two ENTER key strokes, and can bethought of as a paragraph. For more information on properties, see the Object property reference in the online Help. Selecting text to change properties When you specify properties for a text object, the way you select the textdetermines how Paradox applies the properties. To change properties for the entire text object 1Click away from the object. 2Right-click the text object and click Properties. 3In the T ext Properties dialog box, specify properties for the text asappropriate. Paradox applies the properties to all text in the text object. To change properties for selected text 1Drag to highlight the text. 2Right-click the highlighted text and click Properties. 3In the T ext Properties dialog box, specify properties for the text as appropriate. Paradox applies the properties only to the highlighted text. To change properties for text you are about to type 1Click within the text to place the insertion point in the text object but do not highlight any of the text. 2Right-click the text object and click Properties. 3In the T ext Properties dialog box, specify properties for the text asappropriate. Paradox applies the properties to any new text you type. 458 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
Specifying a font and typestyle for text You can specify the font, typeface (for example, Courier or Times Roman), size, style (for example, bold or italic), and color of the text, by using the T ext Formatting T oolbar and the text object property pages. You can also use the Properties dialog box. To use the Text Formatting toolbar 1Select the text object or highlight the text you want to change. 2Click the appropriate tool on the T ext Formatting T oolbar. To use the Properties dialog box 1Select the text object or highlight the text you want to change. 2Right-click the text object or highlighted text and click Properties. 3In the text Properties dialog box, specify properties for the text asappropriate. The typefaces available from the T ypeface menu depend on which fontsare installed on your system. Aligning text You can align values in a field or table object, and you can align text in a textobject and in the edit region of a field object. You can also use the Propertiesdialog box to align text. To use the Text Formatting Toolbar 1Select the field, table, or text object in the Form Design or Report Design Window. 2Click an alignment tool on the T ext Formatting T oolbar. To use the Properties dialog box 1Select the field, table, or text object in the Form Design or Report Design Window. 2Right-click the object or highlighted text and click Properties. 3Click the T ext page. Working with design objects459 | 292806769-Paradox-9-Eng.pdf |
4Enable one of the following Alignment buttons: Left lines up text at the left, with the right edge ragged. Center clusters text in the middle of the object. Right lines up text at the right, with the left edge ragged. Justify spreads out text so both left and right margins are straight. Tabs, margins, indents, line spacing, and alignment options are also available from the expanded ruler. Specifying the line spacing for text You can specify the line spacing for text using the T ext Formatting T oolbar orthe Properties dialog box. To use the Text Formatting Toolbar 1Select the text object or highlight the text to change. 2Click a line spacing tool on the T ext Formatting T oolbar. To use the Properties dialog box 1Select the text object or highlight the text you want to change. 2Right-click the text object or highlighted text and click Properties. 3Click the T ext page and set the Line Spacing property on the T ext page. Tabs, margins, indents, line spacing, and alignment options are alsoavailable from the expanded ruler. Specifying how a text object grows T ext objects in forms and reports grow and shrink to fit text differently,depending on how you create them. After you create a text object, you canspecify how it resizes when the text within it grows and shrinks. To specify how a text object grows 1Right-click the text object and click Properties. 460 Paradox 9: Chapter 8 | 292806769-Paradox-9-Eng.pdf |
2In the Design Sizing area of the General page, enable one of the following buttons: Fixed Size wraps the text at the right border of the frame. The object does not grow or shrink to fit the amount of text it contains. If you want to change the size of the object, select it and resize it manually. Fit T ext creates a single-row text object that expands to the right until you press ENTER, which moves the insertion point to a new line. As you continue typing, the text wraps at the right border that youdefined by pressing ENTER. The object grows or shrinks to fit the amount of text it contains. Grow Only creates a single-row text object that works like Fit T ext, except the object does not shrink when you remove text (unless youmanually resize it using the handles). The most common use for this type of text object is for a field label in atable. The Design Sizing choices control only how the object grows in the Design Window, not what happens when you run (view or print) the formor report. Working with design objects 461 | 292806769-Paradox-9-Eng.pdf |
Exchanging data 463EXCHANGING DATA 9 Paradox provides several ways to exchange data with other programs: Import or Export commands on the File menu can be used to open and save data in a variety of database, spreadsheet, and text formats. Object Linking and Embedding (OLE) can be used to insert files from an OLE server application into Paradox. When you place data into Paradoxusing OLE, you can then access the OLE source application directly from Paradox to make any changes you want. You can also use OLE to embedan entire Paradox table into another applications document. Importing/exporting and OLE are both ways of exchanging informationbetween applications. The difference between them is the method by whichthe information is exchanged. When you import or export a file, it must beconverted to a format that can be understood by the application in which it isto be placed. This means that you must have a special filter installed on yoursystem for each different file format. When you use OLE, you dont need toworry about filters or file formats. As long as all the applications involvedsupport OLE, information can be freely exchanged. Dynamic Data Exchange (DDE) can be used to send field values from a Paradox table to other applications, or to send data from other applicationsto a Paradox table or query. Programmers can use DDE in Object PAL tosend commands to other applications. Whereas Paradox supports an OLEfield type that can store OLE data, DDE links cannot be stored in a table. File, Send can be used to transfer messages and attached files through MAPI-compliant mail systems such as Microsoft Exchange. | 292806769-Paradox-9-Eng.pdf |
You can also exchange information with client/server database applications using Structured Query Language (SQL). See Connecting to the SQLserver in the online Help for details. Sharing information between workstations If you are sharing tables that are stored on a workstations shared disk, the Local Share property for that workstation must be set to TRUE (using the Borland Database Engine Administrator, IDAPI or ODAPI utilities). Local Share only needs to be set to TRUE on the workstation that stores thetables. However, it is recommended that you set all your workstations to TRUE. Setting the Local Share property Configuring the Local Share property incorrectly can result in problemslocking tables and records and the corruption of tables and indexes. T o avoidproblems entirely, you may want to set the Local Share property on all ofyour workstations to TRUE. To set the Local Share property to TRUE 1From the Start menu, click Start, Programs, Paradox 9, Utilities, Borland Database Engine 5. 01. 2Click the Configuration tab. 3Open the Configuration/System folder so that INIT is displayed. 4Click INIT. 5In the Definition page, click Local Share to select it. 6Choose TRUE from the Local Share list box. All BDE-based applications should be shut down when changing settingsin the BDE Administrator. Importing data You can import data from a different file format to a Paradox or d BASE table. You can import only data files, not applications or forms. You can use the T ext Import Expert to assist with importing fixed length and delimited text files. Ifthe Expert is installed, youll have an opportunity to use it when you click File, Import. 464 Paradox 9: Chapter 9 | 292806769-Paradox-9-Eng.pdf |
You can also import tables or lists from HTML files using the HTML Import Expert. You can create a new table, replace data in an existing table, or add to data in an existing table. If you create a new table, Paradox defines its structureautomatically. Then you can use Table Restructure to change it if you want. Paradox imports files in the following formats:ASCII Delimited (. TXT,. CSV) ASCII Fixed (. TXT) d BASE tables (. DBF) Excel 3, 4, 5/95, 97 (. XLS) Lotus 1-2-3 v. 1 (. WKS) Lotus 1-2-3 v. 2 (. WK1) Paradox Tables (. DB) Quattro DOS (. WKQ) Quattro Pro DOS (. WQ1) Quattro Pro Windows 1 (. WB1) Quattro Pro Windows 6 (. WB2) Quattro Pro Windows 7, 8 (. WB3) Quattro Pro 9 (. QPW) Determining field names When you import files, you can enable the Use First Row Of Data As Field Names option. When it is enabled, Paradox generates field names from thefirst row of imported data that contains text. If Paradox cannot determine afield name from the imported file, it generates new field names beginningwith the name FIELD001. Additional new field names are numbered FIELD002, FIELD003, and so on. If more than one field seems to have the same name, Paradox adds letters to the duplicate fields (for example, Customer A and Customer B). Importing spreadsheet data When you import spreadsheet data, you can select a specific block in thespreadsheet to import, or you can import the entire spreadsheet. T o avoidconversion problems, you should edit the spreadsheet before importing. Forbest results, do the following: Exchanging data 465 | 292806769-Paradox-9-Eng.pdf |
Remove extraneous entries (such as hyphens, asterisks, and exclamation points). Make sure each column contains only one kind of data and uses only oneformatting option. When importing dates, ensure you import year dates with all four digits toavoid confusion about the implied century. Place column titles in the top row of the selected range because Paradoxuses the first row that contains text to generate field names. (If there areno column titles on the spreadsheet, disable the Use First Row Of Data As Field Names check box in the Spreadsheet Import dialog box. ) Make sure both the spreadsheet you are importing into Paradox and thedestination table in Paradox are closed (if you are importing into anexisting table). Otherwise, Paradox assumes the items are in use. To import spreadsheet data 1Click File, Import. 2Click the Import button. 3T ype the full path and filename of the spreadsheet you want to import inthe From box, or press ... to browse your files. 4T ype the name of the table into which you want to import data in the T obox, or press ... to browse your files. 5If you are importing data into an existing table, enable one of the followingbuttons: Overwrite Existing Tableimports data over existing table data. Append T o Existing Tableimports data without affecting existing records. 6If you want Paradox to create a table called Problems. db if errors occurwhile importing, enable the Write Transfer Failures T o Problems. db checkbox. 7Click the From Spreadsheet page to bring it to the front and enable the Use First Row Of Data As Field Names check box if you want Paradox touse the first row of data in the spreadsheet as field names. 8If you dont want to import the entire file, specify the range you want toimport by specifying the spreadsheet and cell information. For example, ifyou wanted to import cells A1 to B4 from spreadsheet A, you would enter the following range: A:A1..A:B4. By default, Paradox displays the table and any auxiliary tables on completion. 466 Paradox 9: Chapter 9 | 292806769-Paradox-9-Eng.pdf |
Determining spreadsheet field types When you import data from a spreadsheet, Paradox automatically assigns field types to the data. The following table shows how Paradox determines afields type. Spreadsheet value Paradox field type d BASE field type Labels Alpha Character Integers Short, Long Integer, Float number (6,0) or more (depends on or Number (depends on value) value) Decimal numbers Number Float number (20,4) Money Money Float number (20,4) Dates Date Date Date/Time (Excel) Timestamp Character Time (Excel) Time Character The following rules determine which category a column falls into. The datatype for a column is whatever data type can hold all the values in the column. A column containing is converted to Label (text) cell Alpha field (or d BASE character field) Dates and numbers Alpha field (or d BASE character field) Money only Money field in a Paradox table Money and numbers Number field Dates and times Timestamp field (or d BASE character field) As a result of these conversion rules, Paradox often imports numbers in unedited spreadsheets as alpha fields. For example, spreadsheet columnsoften have rows of hyphens separating sections of numbers. Since only analpha field can contain both the numbers and hyphens, the column isconverted to an alpha field even though it contains mostly numbers. Dates are formatted to the Windows short format. Numbers are formattedto the Windows number format. Exchanging data467 | 292806769-Paradox-9-Eng.pdf |
Importing from a table Paradox lets you import data from tables in other programs. Paradox may need to convert the data in the other application into a different format beforeit can be accessed. To import data 1Click File, Import. 2Click the Import button. 3T ype the full path and filename of the file you want to import in the Frombox. 4T ype the name of the table into which you want to import data in the T obox. 5If you are importing data into an existing table, click the T o Table page andenable one of the following buttons: Overwrite Existing Tableimports data over existing table data. Append T o Existing Tableimports data without affecting existing records. 6If you want Paradox to create a table called Problems. db if errors occurwhile importing, enable the Write Transfer Failures T o Problems. db checkbox. 7If you are importing records to an existing file, enable the Write Duplicate Key Records T o Key Viol. db check box if you want Paradox to write keyviolation errors to a separate table. 8Click the Import button. By default, Paradox displays the imported table and any auxiliary tables when the import operation is complete. Importing delimited text You can use the Import command to import delimited text files. Delimitedtext is text that is separated and/or enclosed by the characters you specify. Inorder to read the file, each line of the text file you want to import must endwith a carriage return/linefeed combination to mark the end of a record. Bydefault, Paradox expects the fields in the text file to be separated by commaswith quotation marks surrounding each text field; however, if your file usesother characters, you can specify them in the Import dialog box. When you import a delimited text file, Paradox scans the file to determine the number of fields and the field types the file contains. Dates are formattedto the Windows short format. Numbers are formatted to the Windows 468 Paradox 9: Chapter 9 | 292806769-Paradox-9-Eng.pdf |
number format. Paradox trims strings longer than 255 characters. It stores these as alpha fields. Importing delimited text involves specifying the files you want Paradox to create during the import and then specifying the format of the delimited textin the source file so that Paradox interprets it correctly. To specify the files you want Paradox to use 1Click File, Import. 2Click the Import button. 3T ype the full path and filename of the file you want to import in the Frombox. 4T ype the name of the table into which you want to import data in the T obox. 5If you are importing data into an existing table, enable one of the followingbuttons: Overwrite Existing Tableimports data over existing table data. Append T o Existing Tableimports data without affecting existing records. 6If you want Paradox to create a table called Problems. db if errors occurwhile importing, enable the Write Transfer Failures T o Problems. db checkbox. 7If you are importing data into existing data, enable the Write Duplicate Key Records to Key Viol. db check box if you want Paradox to write anyduplicate key values to a Key Viol table. To specify the format of the source file 1Click the From T ext page to bring it to the front. 2In the Fields Separated By section, specify how the field values in thesource file are separated by enabling the appropriate button. You canchoose commas, semicolons, tabs, or choose Other and type the characteryou want to use. 3In the Fields Delimited By section, specify the characters that surroundvalues in the source file by enabling the appropriate button. You canchoose quotation marks, nothing, or choose Other and type the characteryou want to use. 4In the Delimited Fields section, specify whether data from all field typesor only from text field types (alpha or character) are separated with thecharacter you chose in step 3. Exchanging data 469 | 292806769-Paradox-9-Eng.pdf |
5In the Character Set section, specify the character set you want to use by enabling either the OEM or ANSI button. 6Enable the Use First Row Of Data As Field Names if you want Paradox touse the first row of data in the source file as field names. By default, Paradox displays the table and any auxiliary tables on completion. You can also import delimited text with the help of the T ext Import Expert. T o activate the Expert, click File, Import and click the T ext Expert button. Importing fixed length text You can import data from fixed length text files using the Import command(File menu). When you import text, each line of the text file you want toimport must end with a carriage return/linefeed combination to mark the endof a record. When you import a fixed length text file, you can define the field names and types of the fields in the new table. For each field name, you will need toenter a T ype for the target table, a Start position (the position in the sourcewhere the column starts), and a Length (the source files field size). Otherwise, Paradox assumes there is one alpha field in the first column of thetable with a length of 255 characters. Dates are formatted to the Windowsshort format. Numbers are formatted to the Windows number format. If you have previously imported data and saved the specifications, you can reload them. Similarly, once you set your import specifications, you can savethem for later use. Importing fixed length text involves specifying all the files you want Paradox to use and/or generate, and then defining the name, type, and size of eachfield in the source file. To specify the files you want Paradox to use 1Click File, Import. 2Click the Import button. 3T ype the full path and filename of the file you want to import in the Frombox. 4T ype the name of the table into which you want to import data in the T obox. 470 Paradox 9: Chapter 9 | 292806769-Paradox-9-Eng.pdf |
5If you are importing data into an existing table, click the T o Table page and enable one of the following buttons: Overwrite Existing Tableimports data over existing table data. Append T o Existing Tableimports data without affecting existing records. 6If you want Paradox to create a table called Problems. db if errors occurwhile importing, enable the Write Transfer Failures T o Problems. db checkbox. 7If you are importing records to an existing file, enable the Write Duplicate Key Records T o Key Viol. db check box if you want Paradox to write keyviolation errors to a separate table. 8In the Character Set section of the T o T ext page, choose the character setyou want to use by enabling either the OEM or ANSI button. Files createdin DOS-based applications, like Edit, typically use the OEM character set. Files created in Windows applications, like Notepad, typically use the ANSI character set. To define the fields from the source file 1Click the From Fields page to bring it to the front. 2If you want to use a previously saved specification, click Load Spec andchoose the appropriate file. You can then modify the specification. 3T ype the name of the first table field in the Field Name box. 4T ype the field type in the T ype box. 5T ype the column at which that field starts in the text file in the Start box. 6T ype the length of the field in the Length box. 7Repeat steps 3 to 6 for each field. 8If you want to save the export specifications, click the Save Spec buttonand type a filename for the file in the File Name box of the Save Import Specification As dialog box. Warning! Importing and exporting of date information depends on the mode settingin the BDE. For example, the date 12/20/98 will fail if the mode setting isanything other than m/d/y or 0. You must change your settings in the BDEto correspond with the date you are importing or exporting for the date totransfer correctly. All other dates in Paradox are affected by this change. Exchanging data 471 | 292806769-Paradox-9-Eng.pdf |
You can also import fixed length text with the help of the T ext Import Expert. T o activate the Expert, click File, Import and click the T ext Expert button. Exporting data You can export data from Paradox tables to the following file formats: ASCII Delimited text (. TXT,. CVS) ASCII Fixed length text (. TXT) d BASE 5 (. DBF) d BASE III+ (. DBF) d BASE IV (. DBF) Excel 3, 4, 5/95, (. XLS) Lotus 1-2-3 v. 1 (. WKS) Lotus 1-2-3 v. 2 (. WK1) Paradox 3. x Compatible (. DB) Paradox 4. x Standard (. DB) Paradox 5, 7, 8 (. DB) Quattro DOS (. WKQ) Quattro Pro DOS (. WQ1) Quattro Pro Windows 1, (. WBI) Quattro Pro Windows 5 (. WB1) Quattro Pro Windows 6 (. WB2) Quattro Pro Windows 7, 8 (. WB3) Word Perfect 8, 9 (. WPD) Word Perfect 8, 9 Merge File (. WPD) In order to export a file in Word Perfect format, you must have Word Perfect installed on your system. 472 Paradox 9: Chapter 9 | 292806769-Paradox-9-Eng.pdf |
Exporting to a spreadsheet You can export table data to a variety of spreadsheet applications. When you export data to a spreadsheet, Paradox converts each record to a row and eachfield to a column. If a value is wider than the column display width, the fullvalue is converted but partially hidden. If a date in the original table is beyond the range of the allowable dates in the spreadsheet, the date is exported as the value ERROR. To export to a spreadsheet 1Click File, Export. 2If the table you want to export is not already listed in the From box, clickthe ... button and choose a table. 3From the T o T ype list box, choose the spreadsheet format you want toexport to. 4If you want Paradox to write field names as the first row of data, click the T o Spreadsheet page and enable the Use First Row Of Data As Field Names check box. Paradox cannot export memo (Paradox or d BASE), formatted memo,graphic, OLE, or binary field types to spreadsheets. These types will notbe included in the exported text file. Dates are exported to spreadsheets as integers representing that date. Format your date column in the spreadsheet as a date to see themproperly. Exporting to a table When you export data to a table, you can create a new table or modify anexisting one. To export data to a table 1Click File, Export. 2If the table you want to export is not already listed in the From box, clickthe ... button and choose a table. 3From the T o T ype list box, choose the type of table you want to export to. 4T ype the full path and name of the file you want to export to in the T o box. Exchanging data473 | 292806769-Paradox-9-Eng.pdf |
5If you are exporting to an existing table, enable one of the following buttons: Overwrite Existing Tableoverwrites the existing table data. Append T o Existing Tableadds new records to the existing table without affecting existing data. 6If you want Paradox to create a table called Problems. db if errors occurwhile exporting, enable the Write Transfer Failures T o Problems. db checkbox. 7If you want Paradox to create a table called Key Viol. db if records withduplicate key field values are found while exporting, enable the Write Duplicate Key Records T o Key Viol. db check box. By default, Paradox displays the table and any auxiliary tables on completion. Exporting to delimited text You can export a table to a text file in which the tables field values areseparated and/or enclosed (delimited) by the characters you specify. Bydefault, field values in the exported file are separated by commas, andnon-numeric values are enclosed in double quotation marks. Each record isseparated by a carriage return and a linefeed character. Dates, numbers, andtimes are formatted as specified in the BDE Configuration Utility program(available in the Paradox program group). To export to delimited text 1Click File, Export. 2If the table you want to export is not already listed in the From box, clickthe ... button and choose a table. 3From the T o T ype list box, choose ASCII Delimited. 4In the Fields Separated By section, choose how you want field values tobe separated in the exported file by enabling the appropriate button. Youcan choose commas, semicolons, tabs, or choose Other and type thecharacter you want to use. 5In the Fields Delimited By section, choose the characters you want tosurround values in the exported file by enabling the appropriate button. You can choose quotation marks, nothing, or choose Other and type thecharacter you want to use. 6In the Delimited Fields section, choose whether you want to surrounddata from all field types or only from text field types (alpha or character)with the character you chose in step 5. 474 Paradox 9: Chapter 9 | 292806769-Paradox-9-Eng.pdf |
7In the Character Set section, choose the character set you want to use by enabling either the OEM or ANSI button. 8Enable the Use First Row Of Data As Field Names if you want Paradox toplace the field names in the first row of data. Paradox cannot export memo (Paradox or d BASE), formatted memo,graphic, OLE, or binary field types to delimited text. These types will notbe included in the exported text file. Exporting to fixed length text You can export a table to a text file in which each record is the same length. When you export to a fixed length text file, you can use the T o Fields page of the Export dialog box to define the field names and types of the fields in thenew table. Dates, numbers, and times are formatted as specified in the BDEConfiguration Utility program (available in the Paradox program group). These settings are called the export specifications. If you have previously exported data and saved the specifications, you can reload them. Similarly, once you set your export specifications, you can savethem for later use. To export to fixed length text 1Click File, Export. 2If the table you want to export is not already listed in the From box, clickthe (... ) button and choose a table. 3In the T o T ype list box, choose ASCII Fixed. 4In the Character Set section of the T o T ext page, choose the character setyou want to use by enabling either the OEM or ANSI button. 5T o display the export specifications, click the T o Fields page and click Reset. 6T o save the export specifications, click Save Spec and type a filename forthe file in the File Name box Warning! Importing and exporting of date information depends on the mode settingin the BDE. For example, the date 12/20/98 will fail if the mode setting isanything other than m/d/y or 0. You must change your settings in the BDE Exchanging data 475 | 292806769-Paradox-9-Eng.pdf |
to correspond with the date you are importing or exporting for the date to transfer correctly. All other dates in Paradox are affected by this change. When you export to a fixed length file, a file with extension. SCH iscreated in the same directory. The. SCH file contains this informationabout the new file: table name, new file type, character set used. It alsocontains descriptive data for each field, including name, type, size, decimalplacement, and column start location (in spaces). If you want to use a previously created export specification, click the Load Save button instead of the Reset button. Using Object Linking and Embedding (OLE) You can use OLE fields to hold virtually any kind of data, from graphics totext to calculations. The advantage of using an OLE field is that once youplace a linked OLE value, it maintains a link to its source application. You canalways open the source application from the OLE object that you place in a Paradox table or form. Changes you make to the OLE object are then updatedin your Paradox table or form. An OLE container can hold different kinds of data, such as images, sound, and documents. Paradox provides two types of OLE containers: fields intables, and design objects in forms or reports. OLE fields and design objectscan be used to store, view, and manipulate this data without leaving Paradox. How you can manipulate an object depends upon the kind of OLE server associated with the object. For example, a sound (. WAV) file might beassociated with a sound editor that provides two commands: play and edit. T o see how you can manipulate the current OLE object, choose the Edit menu. The last command shows the OLE server-specific command. Choosethis to view a submenu of available server-specific commands. Another way to see what you can do with the OLE value is to right-click it in a table (you must click View, Field View first). Youll see a menu of availablecommands. If the value is linked, youll see the Update Now command whichyou can use to force an update whenever you want. The most common commands for OLE values are Edit and Open. If you choose Edit on an embedded OLE value, you can use in-place editing tochange the value. If you choose Open on a linked or embedded OLE value,Paradox opens the server application with the OLE file active. 476 Paradox 9: Chapter 9 | 292806769-Paradox-9-Eng.pdf |
Most server applications use OLE 2. 0, but a few might still use OLE 1. 0, which doesnt support in-place editing. For more information on thedifference between edits and updates in these versions of OLE, see OLE 1. 0versus OLE 2. 0" on page 487. Understanding OLE Object Linking and Embedding (OLE) provides a way for a data file from oneapplication (for example, a Paradox table) to contain data from anotherapplication (for example, a spreadsheet). OLE makes it possible for you toview and edit this data in Paradox without ever leaving Paradox. For example,you can use OLE to link or embed a Corel DRAW image in a graphic field ofa table. In this example, Paradox acts as the OLE container and Corel DRAWacts as the OLE server. Paradox can act as both an OLE container and an OLE server. Paradox as an OLE container OLE containers can be added to tables, forms, and reports. For example, you could add an OLE field to a table you use to organize sound (. WAV) files,allowing you to actually store, play, and edit the. WAV files inside the Paradoxtable. Paradox provides OLE containers in two ways: as a field in a table andas a design object in a form or report. You can insert two kinds of objects into an OLE container: embedded objects and linked objects. Paradox as an OLE server Paradox acts as an OLE server by providing a way to insert a Paradox table inanother applications file, such as a Word Perfect or Quattro Pro file. Depending on the type of OLE object, you can manipulate the object in various ways: open, edit, view, or play it. For more information, seeManipulating the contents of an OLE field or design object on page 484. Embedded OLE objects An embedded object is one you create or copy from a file or the Clipboard. When you embed an object in an OLE container, the data is actually copiedinto the OLE container, and no relationship is maintained with the source ofthe data. For example, suppose you copy an image from Corel DRAW to the Clipboard and paste it in an OLE design object in a Paradox form. You canedit and format the object in the form using Corel DRAW; however, theoriginal file from which you copied the image stays unchanged. Furthermore,if you copy the form to a disk, the image is copied along with the form. Exchanging data 477 | 292806769-Paradox-9-Eng.pdf |
Another type of OLE object is linked, not embedded. For more information, see Linked OLE objects on page 478. Paradox provides OLE containers in two ways: as a field in a table and as adesign object in a form or report. If the OLE object is embedded in a table field instead of a design object, itis stored in the. MB file with other table data. Linked OLE objects A linked object is actually a pointer to data somewhere outside of the OLEcontainer. When you insert a linked object in an OLE container, changes youmake to the object are actually made to the source of the object. Furthermore, if you change the source of the object, the object changes inthe OLE container. Using linked OLE objects is helpful when you need todisplay live data that is automatically updated whenever the original datachanges in another application. OLE links can also produce smaller file sizesthan when you embed large objects (such as graphics files) because theobject itself stays in another file. For example, suppose you insert a link to a Word Perfect document in an OLE field in a Paradox table. Later, you modify the Word Perfect document. Yourmodifications also appear in the field in the table. If you copy the Paradoxtable to a disk, the text from the Word Perfect document is not copied alongwith the table. You can make Paradox update the appearance of linked objects automatically. You can also choose to update their appearance manually. Another type of OLE object is embedded, not linked. For details, see Embedded OLE objects on page 477. Paradox provides OLE containers in two ways: as a field in a table and as adesign object in a form or report. Embedding objects in OLE fields and design objects T o make a table, form or report more interesting and informative, you caninclude data such as pictures, detailed notes, spreadsheets, graphics, charts,and similar items. Often these files exist in other applications, or can becreated in them. When you define a field type as OLE, or a design object asan OLE container, you have created an area in which you can embed special 478 Paradox 9: Chapter 9 | 292806769-Paradox-9-Eng.pdf |
data from other sources. Paradox lets you browse your other applications and choose the file that you want to embed in your table, form, or report. Embedding a new OLE object Paradox does not limit you to placing existing values in OLE fields. You cancreate a new value using an OLE server directly from Paradox. To create a new OLE object and embed it in an OLE field 1Press F9 to switch to Edit mode. 2Select the OLE field. 3Click View, Memo View if your OLE field is a memo field, or View, Field View if your OLE field is a BLOB field. 4Right-click and choose Insert Object. 5In the Insert Object dialog box, enable the Create New button. 6From the Object T ype list, choose the program you want to use to createthe object. If you want Paradox to display the value as an icon in the field, enable the Display As Icon check box. 7Click OK. If the OLE object comes from an OLE 2. 0 server application, Paradox places a blank OLE object in the field and creates an in-place editingenvironment where you can use the server applications standardcommands and toolbar buttons to create the new object. If the server uses OLE 1. 0, the server application opens and you can edit the object within it. 8Create the object using the chosen application. When you are finished creating the object, close the OLE server (the other program) by clicking somewhere outside of the OLE object. Paradoxembeds the object in the OLE field. To create a new OLE object and embed it in a form or report 1Open a form or report. 2Click View, Design Form or View, Design Report to enter Design mode. 3Use the OLE tool to create a design object (box) to hold the OLE object. 4Follow steps 4 to 8 in the above procedure. Exchanging data 479 | 292806769-Paradox-9-Eng.pdf |
T o create a new linked OLE object instead, see Inserting an OLE object linked to a file on page 482. Embedding a copy of a file as an OLE object If the OLE object you want to embed already exists, you can browse yourapplications while in Paradox and choose the file you want to embed. To embed a copy of a file in a table 1Press F9 to switch to Edit mode. 2Select the OLE field. 3Click View, Memo View if your OLE field is a memo field, or View, Field View if your OLE field is a BLOB field. 4Right-click and choose Insert Object. 5Enable the Create From File button. 6T ype the full path and filename of the file you want to embed in the OLEfield in the File box. Paradox embeds a copy of file in the OLE field. To embed a copy of a file in a form or report 1Open the form or report. 2Click View, Design Form or View, Design Report to enter Design mode. 3Use the OLE tool to create a design object (box) to hold the OLE object. 4Follow steps 4 to 6 in the above procedure. T o create a linked OLE object instead, see Inserting an OLE object linked to a file on page 482. Embedding part of a file as an OLE object Paradox lets you go to another application, make a copy of the object youwant in your table, form, or report, and copy and paste it back to yourdatabase. 480 Paradox 9: Chapter 9 | 292806769-Paradox-9-Eng.pdf |
To embed part of a file using Copy and Paste 1Open the OLE server (the program used to create the file you want to embed) and select the value (such as text, a graphic, a number) you wantto place into Paradox. Then, use that programs Copy command to copythe data to the Clipboard. 2Go back to Paradox. 3Do one of the following: If you are embedding the object in an OLE field in a table or in a form bound to that table, press F9 to switch to Edit mode. Click View, Memo View if your OLE field is a memo field, or View, Field View if your OLEfield is a BLOB field. If you are embedding the object in an OLE design object in a form orreport, click View, Design Form or View, Design Report to enter Design mode and select the object. 4Click Edit, Paste. The OLE value appears in the field as an embedded OLE object. T o create a linked OLE object, see Inserting an OLE object linked to part of a file on page 483. Embedding a Paradox table You may want to insert a copy of a Paradox table in another application suchas a word processor or a desktop publishing program. You can embed anentire Paradox table in another application by using the Clipboard or the Insert Object command. To place a Paradox table in another application using the Clipboard 1In Paradox, open the table. 2Click Edit, Select All. 3Click Edit, Copy. Exchanging data 481 | 292806769-Paradox-9-Eng.pdf |
4In the OLE container application, choose the command that the application uses to embed OLE objects. Some commonly used commandsare Edit, Paste, Edit, Paste Special or Edit, Paste Link. The Paradox table appears in the other program (the container). You can edit the table by either opening Paradox from the OLE container or usingin-place editing. To embed a Paradox table using the Insert Object command 1In the OLE container application (not Paradox), click Edit, Insert Object or Insert, Object (depending on the commands available from the OLEprogram). 2In the Insert Object dialog box, choose Paradox Table from the Object T ype list and click OK. 3The OLE container launches Paradox (if it wasnt already running) and Paradox opens the Open Table dialog box. Choose the table you want toembed. 4Paradox opens the selected table. Close the Table window to return to the OLE container. The Paradox table appears in it. Inserting linked OLE objects If you want objects such as spreadsheets, photographs, or charts in yourtable, you must insert and link the object to your OLE field. An OLE linkedobject is stored in its original application. When the original file is updated, sois your OLE field by virtue of the link you have defined. You can decidewhether you want these updates to appear automatically or if you want tomanually update the object. Inserting an OLE object linked to a file If you want your database to include a field with information that isconstantly updated, such as a spreadsheet or sales report, you can link theobject to a Paradox table. The object is contained in its original serverprogram. To insert an OLE object linked to a file into a table 1Press F9 to switch to Edit mode. 2Select the OLE field. 3Click View, Memo View if your OLE field is a memo field, or View, Field View if your OLE field is a BLOB field. 4Right-click and choose Insert Object. 482 Paradox 9: Chapter 9 | 292806769-Paradox-9-Eng.pdf |
5Enable the Create From File button. 6T ype the full path and filename of the file you want to embed in the OLE field in the File box. 7Enable the Link check box. To insert an OLE object linked to a file into a form or report 1Open the form or report 2Click View, Design Form or View, Design Report to enter Design mode. 3Use the OLE tool to create a design object (box) to hold the OLE object. 4Follow steps 4 to 7 in the above procedure. T o create an embedded OLE object instead, see Embedding a copy of afile as an OLE object on page 480. Inserting an OLE object linked to part of a file You may want to select only part of a file to insert in your OLE field or designobject. To insert an object linked to part of a file using Copy and Paste Special 1Open the OLE server (the program used to create the file you want to link) and select the value (such as text, a graphic, a number) you want toplace into Paradox. If you are creating a new file or make changes to thefile, you must Save the changes before you copy the data. 2Use that programs Copy command to copy the data. 3Go back to Paradox. 4Do one of the following: If you are embedding the object in an OLE field in a table or in a form bound to that table, press F9 to switch to Edit mode. Click View, Memo View if your OLE field is a memo field, or View, Field View if your OLEfield is a BLOB field. If you are embedding the object in an OLE design object in a form orreport, click View, Design Form or View, Design Report to enter Design mode. Exchanging data 483 | 292806769-Paradox-9-Eng.pdf |
5Select the OLE field or OLE design object in which you want to paste the OLE object. 6Click Edit, Paste Special. The OLE value appears in the field as a linked OLE object. T o create an embedded OLE object with the Clipboard, see Embedding part of a file asan OLE object on page 480. Manipulating OLE objects in tables, forms, and reports Just as you can edit data in alpha or money fields, you can edit objects in OLEfields. While in Paradox, you can edit the OLE object in its source applicationwhether the object is linked or embedded. If you have instructed Paradox toupdate a linked OLE object automatically, the changes will appear as soon asyou return to your field or design object. If you have chosen to updatemanually, you can use the Update Now command as soon as you are finishedediting. Manipulating the contents of an OLE field or design object An OLE field in a table can be edited or otherwise manipulated eitherthrough the table or through a form that is bound to that table. To manipulate an OLE object in a table 1Press F9 to switch to Edit mode. 2Click the OLE field to select it. 3Click View, Memo View if your OLE field is a memo field, or View, Field View if your OLE field is a BLOB field. 4Click the Edit menu. The last command on the Edit menu is the name of the OLE server associated with the object in the OLE field. Choose thiscommand to display a submenu and then choose one of the commandsfrom the submenu. When youve finished editing the object, save it and close the source application. To manipulate an OLE object in a form or report 1Do one of the following: If the OLE design object is in a form, click View, Design Form to switch to Design mode. If the OLE design object is in a report, click View, Design Report toswitch to Design mode. 484 Paradox 9: Chapter 9 | 292806769-Paradox-9-Eng.pdf |
2Click the OLE design object to select it. 3Follow step 4 in the above procedure. When you are finished manipulating a linked OLE object, Paradox updates it automatically if you have specified this in the Links dialog box. If youhave specified that you want to update the OLE object manually, you canuse the Update Now command. For more information, see Updating alinked OLE object on page 485. Double-clicking the OLE field executes the default command (the firstcommand in the submenu), usually Edit. If you are manipulating this object using a form, right-click the field. Thecommands available for this object appear on the menu. If you aremanipulating this object using a table, press F2 to switch to Field Viewand then right-click the field. Updating linked OLE objects You choose to link an OLE object because you know the object is not staticand will change in its source application. You want your table, form or reportto contain the latest versions of the object. Paradox can update your linked OLE object automatically; however, you may also choose to do it manually. Paradox also allows you to change or break OLE links. Use the Links dialog box to manage links between OLE objects in Paradox and their source files. Updating a linked OLE object You can update your linked OLE object to reflect changes that have occurredin the OLE server. To update a linked OLE object in a table 1Press F9 to switch to Edit mode. 2Select the OLE field. 3Click View, Memo View if your OLE field is a memo field, or View, Field View if your OLE field is a BLOB field. 4Click Edit, Links. Exchanging data485 | 292806769-Paradox-9-Eng.pdf |
5Do one or more of the following: Use the Update buttons to choose whether you want the selected link to be updated manually (when you choose) or automatically. Choose Update Now to immediately make the appearance of a linkedobject match that of its source. See Manually updating a linked objecton page 486 for more information. Choose Open Source to open the server application and source file ofthe selected link. Choose Change Source to change the source file of the selected link. Paradox opens the Change Source dialog box. Use this to choose a newsource file for the link. Choose Break Link to break the link. This causes the selected OLEvalue to become a static, embedded object. Now the object cant beautomatically updated when the source data changes. To update a linked OLE object in a form or report 1Open the form or report. 2Click View, Design Form or View, Design Report to enter Design mode. 3Select the OLE object. 4Follow steps 4 and 5 in the above procedure. Manually updating a linked object After you have edited your OLE object, you can update the object to showthe changes whenever you want. Make sure you have clicked Manual in the Links dialog box. To update your object manually 1Do one or both of the following: If you are working with an OLE field in a table or in a form bound to that table, press F9 to switch to Edit mode. Also, make sure you arenot in Field View mode. If you are working with an OLE field object in a form or report, click View, Design Form or View, Design Report. 2Click the OLE field or design object to select it. 3Click Edit, Links, Update Now. 486 Paradox 9: Chapter 9 | 292806769-Paradox-9-Eng.pdf |
OLE 1. 0 versus OLE 2. 0 Some objects behave differently from other objects when manipulated. Differences are sometimes due to the version of OLE supported by an OLEserver. There are two kinds of OLE servers: OLE 1. 0 and OLE 2. 0. OLE 1. 0 When you manipulate an object from an OLE 1. 0 server, Paradox launchesthe OLE server (the program used to create the OLE object) to let you workwith the object. After you finish working with the object, close the OLEserver to return to Paradox and save the changes to the object. For example, suppose an OLE field contains a word processing document, and you choose the Edit command. Paradox opens the document in the wordprocessor. You make some changes to the document and close the wordprocessor. A dialog box appears, asking if you want to save the changes to theobject. You choose OK and return to Paradox. The object in the OLE field isupdated with the changes you made. OLE 2. 0 When you manipulate an object from an OLE 2. 0 server, different commandsmay cause different actions. T ypically, one command (Open) launches the OLE server (the program used to create the OLE object). Another command(Edit) initiates in-place editing. With in-place editing, all the tools and menusyou need appear inside the Paradox desktop. In essence, the OLE servertakes control of the Paradox desktop, including the toolbar, the status line,and the menus. The area inside the OLE field becomes the working area forthe OLE server. The only menus that Paradox still controls are File and Window. T o end in-place editing and restore the standard Paradoxenvironment, click the table or form outside the OLE field or design object. For example, suppose an OLE field contains a video file, and you choose the Play command. Video controls appear at the bottom of the OLE field andsome new menu commands appear on the Paradox desktop. The video playsinside the OLE field. You use the video controls to pause and jump to anotherframe in the video. You click another field in the table to close the videoplayer. Using Paradox as an OLE 2. 0 server You can embed existing Paradox tables in OLE container applications such asword processors or spreadsheets. T o do this, you can use the Edit, Insert Object command or the Windows Clipboard. Exchanging data 487 | 292806769-Paradox-9-Eng.pdf |
If the container application supports OLE 2. 0, you can use in-place editing to edit the Paradox table. When you use in-place editing, certain functions areunavailable: You cannot right-click the table to see its properties. You cannot enter Memo View. Certain prohibited menu commands are not visible. The Paradox table you place in the container always maintains a relationship with the Paradox source table. This means if you delete the Paradox file fromdisk, it will no longer appear in the OLE container (even if it was embeddedin the OLE container). Using Dynamic Data Exchange (DDE) Dynamic Data Exchange (DDE) lets you communicate with otherapplications that support DDE. You can use DDE to send field values from a Paradox table to other applications or to send data from other applications toa Paradox table or query. DDE links are shown as text, not icons or data. For an example, see Using Paradox as a DDE client (tables) on page 489. Using Paradox as a DDE server When you take the values from a Paradox field and place them in anotherapplication, you are using Paradox as a Dynamic Data Exchange (DDE)server. Using Paradox as a DDE server Suppose you have a spreadsheet that performs a series of calculations on avalue. The value you want to perform the calculations on is in a field of a Paradox table. 1With the appropriate Paradox table open, select any value in the field, then choose Edit, Copy to copy the field to the Clipboard. 2In the DDE client spreadsheet, use Paste Special to place the field in theappropriate spreadsheet cell. In the Paste Special dialog box, enable the Paste Link button. Remember, you are not placing an actual value in the spreadsheet. Instead, you are using DDE to tell the spreadsheet where to look for thevalue. As you move through the records of your Paradox table, the values in thespreadsheet change because the value in the field is different for different 488 Paradox 9: Chapter 9 | 292806769-Paradox-9-Eng.pdf |
records. The spreadsheet displays the field value for the selected Paradox record. You can use DDE to place Paradox fields in any type of application that is a DDE client. Spreadsheets, word processors, and a variety of otherapplications can accept Paradox field values through DDE. T o link an entire table through DDE, click Edit, Select All, and then Edit,Copy. Example of Paradox as a DDE server Suppose you want to place a Paradox fields value in a cell in a Quattro Profor Windows spreadsheet. The following example shows how to do this usingthe sample Orders table. 1In Paradox, open the Orders table. Select the first records T otal Invoice value. 2Click Edit, Copy. 3Open Quattro Pro for Windows, select a notebook cell and click Edit,Paste Special. 4Enable the Paste Link button in the Paste Special dialog box. 5T o see how DDE works, place your Paradox window and your Quattro Prowindow together on the screen. 6Select the T otal Invoice field in Paradox and press the up and down arrowsto move through invoice values. Notice how the value shown in thenotebook cell in Quattro Pro changes to display the T otal Invoice value inthe currently selected Paradox record. In Quattro Pro, you can create calculations that use the value from Paradox. As the DDE value is updated, the calculated result is updatedalong with it. Using Paradox as a DDE client (tables) When you use Paradox as a DDE client, you place link information about avalue from another application into an alpha field in a Paradox table. A common use of Paradox as a DDE client is to use values from another application and perform queries on them in Paradox. Exchanging data489 | 292806769-Paradox-9-Eng.pdf |
To use Paradox as a DDE client 1Copy the value you want to use (your DDE server can be a spreadsheet, word processor, or any other DDE-capable application). 2In Paradox, click the alpha field where you want to place the DDE valueand then click Edit, Paste Special. You see link information like:@DDE:"QPW"!"C:\QPW\NOTEBK1. WB1"!"$A$D$2"!@. This is a string that tells Paradox where to look for the DDE value. This example string tells Paradox to look for a Quattro Pro for Windows filelocated on C:\QPW in Notebook 1, page A, cell D2. In Paradox, you view the link information rather than the DDE value. T oview the value in the DDE server, select the field and press Shift + F2. Paradox displays a message telling you it is launching the DDE server andthen opens the application and the correct file. The alpha field must be large enough to hold link information. Using Paradox as a DDE client (queries) To use Paradox as a DDE client (queries) 1Highlight the item in the server, then copy it to the Clipboard. Mostservers use Edit, Copy to place a copy of the object on the Clipboard. 2Return to the client (Paradox) Query window. 3Select the QBE field to receive its value from the server. 4Click Edit, Paste Link from the menu. 5Click Query, wait for DDE to tell Paradox to execute the query each timedata is sent from the server. Example of Paradox as a DDE client and server (queries) When you use Paradox as both DDE client and server, all actions can beperformed within Paradox. For example, a linked field can run a query (the DDE client). When the field value changes in the source table (DDE server), an updated Answer tableappears. 490 Paradox 9: Chapter 9 | 292806769-Paradox-9-Eng.pdf |
Using DDE to run a query Suppose you want to run a separate query for each customer in the Customer table. Follow these steps: 1Click File, New, Query 2Choose Lineitem. db and Orders. db, and click Open. 3Click the checkboxes for the Orders field in both the Lineitem and Orders tables. 4Open Customer in a Table window, click File, Open, Table, double clickthe Customer. db table. 5Select Customer No. 1221 and click the Copy button on the toolbar. 6In the Query window, position the text insertion point in the Customer No. field of the Orders table, and click Edit, Paste Link. Link informationfrom the Customer table appears in the field. 7Click Query, Run Query. Paradox creates an Answer table listing all of Customer No. 1221s items. Using DDE to run a query interactively 1Create a DDE link following steps 1 to 5 of the above procedure. 2Click the Query windows title bar to activate the window. 3Click Query, Wait for DDE. 4Click the Customer tables title bar to activate the window and select Customer No. 1221. 5Press the Down arrow to move to Customer No. 1231. When you selectthe new value, Paradox activates the DDE link and runs the query again,updating the Answer table with the new values data. You can click Query, Wait for DDE so that there is no check mark besidethe menu command if you want to scroll quickly through the Customertable without running a query on each records value. Disconnecting a DDE link After a DDE link is pasted into a DDE client application, the Notify Oncommand is activated in Paradox. While this command is active, the link islive. For example, when you select another record in the linked table (in Paradox), the new value is delivered to the DDE client. Exchanging data 491 | 292806769-Paradox-9-Eng.pdf |
To disconnect the link Click Format, Notify On so that no check mark appears beside the menu option in Paradox. While this command is inactive, no changes are delivered to the DDE client. To reconnect the link at any time Click Format, Notify On so that a check mark appears beside the menuoption in Paradox. If you create a DDE link to an entire table, Format, Notify On workssimilarly. When any record in the linked table changes, the entire table isrefreshed in the DDE client. Changes are posted in the table wheneverthe person editing the table moves off the record. The Notify On is activated only if the Wait for DDE is selected in thequery. Sending mail If you are connected to a MAPI-compliant mail system, you can use the Send Mail command to transfer messages and attached files to others who areaccessible through that system. To send mail Click File, Send T o. If your mail system is currently open, the standard message creation dialog box appears. If it isnt open, the MAPI Choose Profile dialogappears and asks for your mail provider. Once you specify your mailprovider, you can compose a message and attach files following the usualprocedures. When you send the message, it is delivered to the recipients mail boxes asusual, and appears in the incoming mail list the next time they check theirmail. If you encounter problems, contact your email administrator to make sureyou have a MAPI-compliant mail system and to verify that it is properlyconfigured. 492 Paradox 9: Chapter 9 | 292806769-Paradox-9-Eng.pdf |
HTML publishing and Internet tools 493HTML PUBLISHING AND INTERNET TOOLS 10 The Paradox Internet tools allow you to harness the power of the Internet with a few simple steps. Use the Corelfi Web Server (. EXE) for simple,straightforward Web publishing. Use the Corel Web Server Control if youwant to program the server to send custom responses to browser requests orprocess information posted by electronic forms. Creating and working with HTML documents You can easily publish dynamic and static reports and tables to the Internetusing the Paradox HTML Publishing Experts. You can also create static HTML documents from Paradox forms. Static documents are generated atthe time they are saved with the HTML extension. If changes are made tothe original data, they will not be reflected on this page. Dynamic documentsare generated each time it is requested by a browser. Using the Corel Web Server You must have a TCP/IP network connection for the Corel Web Server andthe Corel Web Server Control to function properly. You must also have aproperly configured Web server running on your system in order to receiveand process browser requests. Setting up the Corel Web Server on page 497. Setting Corel Web Server properties on page 497. | 292806769-Paradox-9-Eng.pdf |
Starting and testing the Corel Web Server on page 498. Viewing Corel Web Server connections on page 498. HTML publishing in Paradox The following features simplify HTML publishing in Paradox: the HTML Report Expert the HTML Table Expert the ability to save Paradox forms as HTML files Hyper T ext template (. HTT) files HTML Table Expert The HTML Table Expert converts a table to an HTML text file so you can publish it either statically or dynamically on the World Wide Web. The Expertputs in the appropriate HTML tags and parameters automatically. You canmodify the HTML document created by the Expert as you would any other HTML document. Click File, Publish to HTML to launch the HTML Table Expert. HTML Report Expert The HTML Report Expert helps you convert a report to an HTML text fileso you can publish it either statically or dynamically on the World Wide Web. The Expert puts in the appropriate HTML tags and parameters automatically. You can later modify the resulting HTML document as you would any other HTML document. Click File, Publish to HTML to launch the HTML Report Expert. Any table or report that is published dynamically as HTML to the Private(:PRIV) directory cannot be accessed by a Web server while Paradox isrunning on the same system. Publishing tables to HTML The Paradox HTML Table Expert easily translates any Paradox table to an HTML file, allowing you to choose from a number of publishing options asyou go. 494 Paradox 9: Chapter 10 | 292806769-Paradox-9-Eng.pdf |
To publish a table to HTML 1View the table. 2Click File, Publish to HTML. 3Follow the steps in the HTML Table Expert. The Corel Web Server is case-sensitive, so make sure you note the exact filename used when saving documents for future reference. Publishing reports to HTML The Paradox HTML Report Expert easily translates any Paradox report to an HTML file, allowing you to choose from a number of publishing options asyou go. To publish a report to HTML 1View the report. 2Click File, Publish to HTML. 3Follow the steps in the HTML Report Expert. Any information in the Page band of a report is not published by the HTML Expert. In order for information contained in the Page band to beviewable in an HTML document, it must be placed in the Report Band ofthe Report. Since pages are not supported by HTML, page numbers areignored regardless of where they are placed. The Corel Web Server is case-sensitive, so make sure you note the exactfilename used when saving documents for future reference. Publishing forms to HTML You can publish a Paradox form to a static HTML document. This featureworks best with simple forms that use text, edit boxes, list boxes, radiobuttons or check boxes. Form objects such as graphics, table frames,crosstabs, notebooks and charts do not translate statically to HTML. To publish a form to an HTML file 1View the form. 2Click File, Publish to HTML. HTML publishing and Internet tools 495 | 292806769-Paradox-9-Eng.pdf |
3T ype a filename. 4Choose. HTML as the file type from the list box. 5Click the Save button. Paradox saves an HTML version of your form that can be viewed by a Web browser. Paradox automatically adds FORM METHOD and ACTION tags to anyform published to HTML. By default, the FORM METHOD tag is set to POST and the ACTION is set to the Paradox form objects noise name(e. g., #Form1). T o set these properties yourself, change the HTMLMethod property or the HTMLAction property of the form usingthe Object Explorer. Paradox also adds a Submit button to static forms published to HTML. Forthe Submit button to work with the Corel Web Server Control, you mustadd code to trap the POST action in the On Post Request event. About HTT files An. HTT (Hyper T ext T emplate) file is an HTML file with custom metatags. These tags are Paradox-specific, and are used by the HTML Publishing Engine to produce standard HTML files. Conceptually, an. HTT file is anintermediary step in the Internet publishing system; all layout information isdefined but metatags are used in place of tables, queries, and other databaseobjects. HTT files are generally used in dynamic publishing where the layout information is known but the actual data needs to be resolved at run time. The dynamic publishing of the Corel Web Server (. EXE) manages. HTT filesautomatically, so their existence and function are largely transparent to theuser. If you are implementing your own dynamic publishing system with the Corel Web Server Control, you can generate. HTT files using File, Publish to HTML for tables, reports, and forms. Working with the Corel Web Server The Corel Web Server (. EXE) and related documentation are included whenyou install Paradox. The Setup program also copies the Corel Web Server Control (WEBSRV. OCX) and supporting DLLs into appropriate directoriesand registers them. 496 Paradox 9: Chapter 10 | 292806769-Paradox-9-Eng.pdf |
Installing a TCP/IP protocol Your machine must have a TCP/IP protocol installed for the Corel Web Server and the Corel Web Server Control to function properly. Consult your Windows documentation for details on installing a TCP/IP protocol on yoursystem. Setting up the Corel Web Server For help using the Corel Web Server, right-click the Corel Web Server iconand click View Connections to maximize the Web Server window. Choose Help T opics from the Help menu to open the Corel Web Server (. EXE) Helpfile. To set up the Corel Web Server (. EXE) Click Start, Programs, Paradox 9, Utilities, Corel Web Server. The Corel Web Server icon appears on the Windows Taskbar. It is active and ready to receive browser requests. To add the Corel Web Server Control to a form 1Open a form in the Form Design window. 2Click the Corel Web Server Control button on the Active X Control toolbar. 3Drag over the spot on your form where you want to add the Corel Web Server Control window. Setting Corel Web Server properties You can set properties for the Corel Web Server using the appropriate Web Server Properties dialog box. The Base Path and Default Page properties onthe Web Server Properties dialog box Pages page must be set for the Web Server to function properly. To set Corel Web Server (. EXE) properties Right-click the Corel Web Server icon on the Windows Taskbar and click Properties to open the Web Server Properties dialog box. For more information about Corel Web Server properties, see the Corel Web Server (. EXE) online Help. HTML publishing and Internet tools497 | 292806769-Paradox-9-Eng.pdf |