The NOWAIT clause of REPORT command breaks filter printing report from Preview window (191955)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0
  • Microsoft Visual FoxPro for Windows 7.0
  • Microsoft Visual FoxPro 8.0
  • Microsoft Visual FoxPro 9.0 Professional Edition

This article was previously published under Q191955

SYMPTOMS

When the NOWAIT clause is present in the REPORT FORM command, printing a report by clicking the printer icon in the report preview window will not print according to the filter setting, rather, it prints all the records.

CAUSE

The filter setting is not retained due to the NOWAIT keyword.

RESOLUTION

  • Remove the NOWAIT clause from the end of the REPORT FORM command. -or-

  • Create a cursor with the filter setting before calling the REPORT FORM command.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a table by running the following code:
          CREATE TABLE cust ( Name C(10), State C(2))
          INSERT INTO cust VALUES ("Smith", "MA")
          INSERT INTO cust VALUES ("Mary", "AL")
          INSERT INTO cust VALUES ("Tom", "MA")
          INSERT INTO cust VALUES ("Joe", "MA")
          INSERT INTO cust VALUES ("Tomi", "CA")
          INSERT INTO cust VALUES ("John", "CA")
          INSERT INTO cust VALUES ("Linda", "MA")
  2. Create a quick report based on the preceding table. Save the report as Cust.frx.
  3. Create a program (.prg) and place the following code in the .prg file:
          DEFINE WINDOW wShowInq ;
             FROM 0,0 TO 10,10 ;
             SYSTEM ;
             ZOOM ;
             TITLE [&tcTitle.]
    
          ZOOM WINDOW wShowInq MAX
          USE cust
    
          *-- Comment the NOWAIT clause to obtain the expected results.
          REPORT FORM cust FOR State = "MA"  PREVIEW NOWAIT
  4. Save the program and run it.
When the Print Preview appears, only all the "MA" records are in the print preview.
  1. Click the Printer button on the Report Preview toolbar to print the report.
You will see all the records are printed in the hard copy of the report.

Modification Type:MajorLast Reviewed:2/11/2005
Keywords:kbprb KB191955 kbAudDeveloper