Microsoft KB Archive/117213

{| = BUG: Format Clause in Report Causes Erroneous Characters =
 * width="100%"|

ID: Q117213

The information in this article applies to:


 * Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6

SYMPTOMS
In the Report Writer, if a field has a format clause and an IIF statement in it, erroneous characters will appear if the field is blank.

RESOLUTION
If you remove the format clause ("XXXXXXXXXX" in the example below), the problem will no longer occur.

STATUS
Microsoft has confirmed this to be a problem in FoxPro versions 2.5, 2.5a, 2.5b, and 2.6. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Steps to Reproduce the Problem
1. In the Command window, type the following commands:

CLOSE ALL USE customer.dbf COPY TO test.dbf CLOSE ALL USE test.dbf REPLACE ALL company WITH ' ' FOR state = 'MA' GO TOP CREATE REPORT test.frx 2. In the Report Writer, choose the Field button, place a field in the Detail band, choose the Expression button, and then type the following expression in the Expression For Field On Report box:

IIF(company = ' ','BLANK',company) 3. Choose Verify to make sure the expression is valid, and then choose OK. 4. In the Format box, type the following, and then choose OK.

XXXXXXXXXX 5. From the Report menu, choose Page Preview. Choose the Zoom In button. The first record is displayed as "BLANK00". It should be "BLANK". If the report expression is changed to IIF(company = ' ',' ',company), part of the field prints even though it should appear blank.

Additional reference words: FoxWin 2.50 2.50a 2.50b 2.60 buglist2.50 buglist2.50a buglist2.50b buglist2.60 Report IIF FORMAT RWriter KBCategory: kbprg kbbuglist KBSubcategory: FxtoolRwriter
 * }