home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR13
/
TI_PDOX1.ZIP
/
TI1106.ZIP
/
TI1106.ASC
Wrap
Text File
|
1993-08-26
|
9KB
|
331 lines
PRODUCT : Paradox NUMBER : 1106
VERSION : 4.0
OS : DOS
DATE : August 26, 1993 PAGE : 1/5
TITLE : Using IIF() To Produce Line Squeezing in Report Groups
Intended Audience:
This Technical Information sheet is intended for someone with a
moderate level of Paradox experience.
Prerequisites:
A basic understanding of the Paradox Report Generator and experience
in creating calculated fields.
Purpose of the TI:
The purpose of this Technical Information sheet is to illustrate one
use of the Paradox 4.0 Immediate If PAL function, IIF(), for producing
line squeeze in areas of a report other than the form band, such as
group bands.
It is sometimes desirable to create reports that incorporate line
squeezing in areas other than the form band. A common application for
the Immediate If function is creating invoice reports that contain
customer address information within a group header. In many
instances, the customer record may not include data for a particular
field (i.e "Company"). In Paradox versions prior to 4.0 (because
there is no method of producing line squeezing in areas other than the
form band) a blank line remains when the fields that are placed on a
line of the report do not contain data. The following example
illustrates the use of the Immediate If function in a series of
calculated fields of a report to produce line squeezing in group
bands. For additional information on the Immediate If function, refer
to the PAL Reference Guide.
The IIF function returns one of two values depending on the value of a
logical condition. The syntax of the IIF function is as follows:
IIF(Condition, ValueIfTrue, ValueIfFalse)
PRODUCT : Paradox NUMBER : 1106
VERSION : 4.0
OS : DOS
DATE : August 26, 1993 PAGE : 2/5
TITLE : Using IIF() To Produce Line Squeezing in Report Groups
Suppose you have the following customer information data in a table:
FName╦═LName═╦════Company════╦════Address═══╦═══City═══╦═State╦ZipCode
Ann ║ Smith ║ Systems Design║ 123 Front St.║ Atlanta ║ GA ║ 01234
John ║ Wilson║ ║ 100 Beach Dr.║ San Diego║ CA ║ 90123
The record for Ann Smith contains data for the field "Company";
however, the "Company" field is blank for John Wilson. Suppose you
want to print out the following customer information in the "LName"
group header of a report:
FName LName
Company
Address
City, State ZipCode
Using a series of calculated fields with the IIF function you can line
squeeze in the group header by evaluating the condition where the
field "Company" is blank.
Pictured on the next page is an example of a tabular report that
utilizes the IIF function. The customer information (name, company
and address) is placed in the "LName" group header. All of the fields
shown in the group header are calculated fields. The actual report
spec would show a field mask of "A's" in place of calc expressions.
To create a calculated field in a report:
1. Press <F10> to select the Report Menu
2. Field │ Place │ Calculated
3. Type in the expression
PRODUCT : Paradox NUMBER : 1106
VERSION : 4.0
OS : DOS
DATE : August 26, 1993 PAGE : 3/5
TITLE : Using IIF() To Produce Line Squeezing in Report Groups
....+...10....+...20....+...30....+...40....+...50....+...60....+...70
page ─────────────────────────────────────────────────────────────────
INVOICE NO: 999999
───── group LName ────────────────────────────────────────────────────
[FName]+" "+[LName]
IIF(ISBLANK([Company]),[Address],[Company])
IIF(ISBLANK([Company]),[City]+", "+[State]+" "+[ZipCode],[Address])
IIF(ISBLANK([Company]),"",[City]+", "+[State]+" "+[ZipCode])
─ table ──┬───────────────────┬───────┬──────────┬────────────────────
DATE DESCRIPTION QUANT PRICE AMOUNT
-------- ------------------ ------ --------- ----------------
mm/dd/yy AAAAAAAAAAAAAAAAAA 999999 999999.99 [Quant]*[Price]
─ table ──┴───────────────────┴───────┴──────────┴────────────────────
Total Amount SUM([Quant]*[Price], group)
PAGEBREAK
───── group LName ────────────────────────────────────────────────────
page ─────────────────────────────────────────────────────────────────
══════════════════════════════════════════════════════════════════════
The four calculated field expressions that are contained within the
group header are evaluated as follows:
Line 1: Concatenates the "FName" field to the "LName" field and
separates the two fields with a space.
Line 2: If the "Company" field is blank, then Paradox prints the
"Address" field. If it is not blank, then Paradox prints the
"Company" field.
Line 3: If the "Company" field is blank, then Paradox concatenates
the fields "City", "State" and "ZipCode". If it is not blank,
then Paradox prints the "Address" field.
Line 4: If the "Company" field is blank, then Paradox prints a blank
line. If it is not blank, then Paradox concatenates the
fields "City", "State" and "ZipCode".
PRODUCT : Paradox NUMBER : 1106
VERSION : 4.0
OS : DOS
DATE : August 26, 1993 PAGE : 4/5
TITLE : Using IIF() To Produce Line Squeezing in Report Groups
Each invoice will be printed on a separate page. The report output
will look like this:
---------------------------------------------------------------------
INVOICE NO: 1259
Ann Smith
Systems Design
123 Front St.
Atlanta, GA 01234
DATE DESCRIPTION QUANT PRICE AMOUNT
-------- ------------------ ------ --------- ----------------
5/22/92 486 Computer 1 2000.00 2000.00
5/22/92 Laser Printer 2 800.00 1600.00
Total Amount 3600.00
---------------------------------------------------------------------
INVOICE NO: 1260
John Wilson
100 Beach Dr.
San Diego, CA 90123
DATE DESCRIPTION QUANT PRICE AMOUNT
-------- ------------------ ------ --------- ----------------
5/22/92 386SX Computer 1 1500.00 1500.00
Total Amount 1500.00
PRODUCT : Paradox NUMBER : 1106
VERSION : 4.0
OS : DOS
DATE : August 26, 1993 PAGE : 5/5
TITLE : Using IIF() To Produce Line Squeezing in Report Groups
---------------------------------------------------------------------
Note that this technique emulates the "fixed" version line
squeezing where the blank line(s) is "pushed" down to the bottom.
Variable line squeezing is not possible due to the fact that the
line must remain for potential use.
Without using the IIF function, the record for John Wilson (that has
blank data for the field "Company") would have a blank line between
the line for "FName" and "LName" and the line for "Address" as shown
below:
---------------------------------------------------------------------
INVOICE NO: 1260
John Wilson
<--- BLANK LINE PRODUCED HERE
100 Beach Dr.
San Diego, CA 90123
DATE DESCRIPTION QUANT PRICE AMOUNT
-------- ------------------ ------ --------- ----------------
5/22/92 386SX Computer 1 1500.00 1500.00
Total Amount 1500.00
---------------------------------------------------------------------
There are many different applications of the IIF function. For
additional information on the IIF function, refer to the PAL
Reference Guide.
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that you
received with the Borland product to which this information pertains.