Microsoft KB Archive/129848

{| = PRB: Extra Blank Lines Print in the Detail Section of a Report =
 * width="100%"|

ID: Q129848

The information in this article applies to:


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

SYMPTOMS
When you print a report containing several fields all on a single detail line and you suppress output from all fields for that detail line based on a given condition in a database field, the result contains extra space (blank lines) for those records that don't meet the condition. This happens only when there is extra space between the bottom of the field objects and the top of the Detail band.

STATUS
This behavior is by design.

Steps to Reproduce Behavior
1. Create a database with the following structure and data:

Field Name     Type   Length -  GUESTID         C      5 REP            C      3 LASTNAME       C     15 FIRSTNAME      C     10 REPVAL         L      1 2. After creating the table, enter approximately 30 records or enough to  demonstrate the problem. As you enter the records, set REPVAL equal to  .T. in some cases, .F. in other cases, and null or blank in some. 3. Create a tabular report consisting of this single detail line: [GUESTID] [REP]  [LASTNAME]  [FIRSTNAME] 4. Modify each field in the Detail band such that each field consists of  an expression composed of an IIF statement in the following manner:

IIF( = .T., ,"")

Here is an example: IIF(REPVAL = .T.,GUESTID,"") 5. Enable the option to suppress blank lines for all four fields in the report. To do this, double-click the field, and select the Print When check box. When this option is selected, the Print When dialog box will appear that contains the Remove Line If Blank option. This report works if there are no blank spaces of any kind between the bottom of the field objects and the top of the Detail band. However, if there is any space whatsoever, blank lines are printed regardless of the IIF expression and 'Remove Line If Blank' settings. Any blank space below or above the fields will be printed when the report is printed. This is by design. To demonstrate this, move the Detail band so that it is directly touching the bottom of the field objects. Doing a "Print Preview" should yield all records printed where REPVAL = .T. with all blank lines suppressed. Any records where REPVAL is blank or .F. should not appear. This would be the expected behavior.

Now, move the Detail band down so that there is some blank space and preview the report a second time. You should now see some records printed where REPVAL = .T., some blank lines where records would print if REPVAL was true instead of false or blank, and then some more records where REPVAL is true.

Example:

GUESTID REP   LASTNAME   FIRSTNAME 1    ABC   FARQUAR    LEONARD ---+ 2    JLS   WILLIAMS   SONOMA         | REPVAL is .T. in this case 3    SBT   GATES      WILLIAM+ +                                           | REPVAL is .F. for these | "records" +     8     KAA   FEATHRES   JESSE 9    LWE   SMITH      JACKIE Additional reference words: FoxWin 2.50 2.50a 2.50b 2.60 2.60a report blank line suppress KBCategory: kbprint kbprb KBSubcategory: FxotherGeneral
 * }