FIX: Report Fields Stacked w/ IIF Commands Not Previewed

ID: Q97065

2.00 2.50 MS-DOS kbprg kbfixlist kbbuglist

The information in this article applies to:

SYMPTOMS

In the Report Writer, if conditional IIF commands are used that result in two fields, each with conditional IIF commands, being placed on top of each other, page preview will not show expected results.

STATUS

Microsoft has confirmed this to be a problem in FoxPro versions 2.0 and 2.5 for MS-DOS. This problem has been corrected in FoxPro version 2.5a for MS- DOS.

MORE INFORMATION

Page preview will evaluate only the top IIF field. Therefore, only the conditions in the top IIF field will show up when viewing the document.

When the report is sent to the printer, the IIF fields will be evaluated properly and the report will be printed out with each IIF field and its .T. or .F. contents printed on the report.

Steps to Reproduce Problem

1. Open the FOXPRO2\TUTORIAL\CUSTOMER.DBF database.

2. Create a report and select two fields, such as the CNO and COMPANY

   fields.

3. Add a third field to the Detail line using this syntax in the
   field expression:

      IIF(CUSTOMER.STATE='TX','TEXAS','')

4. Add another field directly on top of the last field with this
   syntax in the field expression:

      IIF(CUSTOMER.STATE ='CA','CALIFORNIA,'')

5. Select Page Preview and look at the results.

   The state of California or a blank will be all that is displayed in
   this field because it is the top field. If the field expression
   that has Texas in it is put on top, then the word TEXAS or a blank
   will appear in page preview.

6. Print out the report and the results will be Texas, California, or
   a blank printed in the fields, depending on the condition of the
   fields.

Normally, placing IIF fields on top of one another is not the preferred way to use the IIF command. Instead of coding separate fields as shown above, one field could be used with the command:

   IIF(CUSTOMER.STATE = 'TX','TEXAS',IIF(CUSTOMER.STATE =
'CA','CALIFORNIA',''))

     Note: Type this command all on one line.

Additional reference words: FoxDos 2.00 2.50 preview buglist2.00 buglist2.50 fixlist2.50a KBCategory: kbprg kbfixlist kbbuglist KBSubcategory: Solution Type : kbfix

Last Reviewed: September 22, 1997