FIX: Report Fields Stacked w/ IIF Commands Not Previewed

Last reviewed: September 22, 1997
Article ID: Q97065
2.00 2.50 MS-DOS kbprg kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft FoxPro for MS-DOS, versions 2.0 and 2.5

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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.