FIX: CREATE REPORT on SELECT-SQL Cursor Uses Original Fields

Last reviewed: October 20, 1997
Article ID: Q118292
2.60 WINDOWS kbprg kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft FoxPro for Windows, version 2.6

SYMPTOMS

After you issue a SELECT-SQL statement in FoxPro version 2.6 for Windows and limit the fields that end up in the new table or cursor, running the CREATE REPORT command on the newly created table or cursor brings up all the fields from the original table. This behavior occurs even when the original table is closed. This behavior cannot be duplicated in any other version of FoxPro.

CAUSE

This problem only occurs when there are no additional clauses (such as WHERE or HAVING) on the SELECT statement.

RESOLUTION

To work around this problem, add a WHERE, HAVING, ORDER BY, or GROUP BY clause to the SELECT statement. If you don't need a clause, add WHERE .T. to the end of the SELECT statement; for example:

   SELECT customer.cno, customer.state;
      FROM customer;
      INTO CURSOR test WHERE .T.
   CREATE REPORT test.frx FROM test WIDTH 788
   REPORT FORM test.frx PREVIEW

The above code works correctly and will display only two fields in the preview: CNO and STATE.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in FoxPro version 2.6a for Windows.

MORE INFORMATION

Steps to Reproduce Behavior

Execute the following commands:

   SELECT customer.cno, customer.state;
      FROM customer;
      INTO CURSOR test
   CREATE REPORT test.frx FROM test WIDTH 788
   REPORT FORM test.frx PREVIEW

All the fields from CUSTOMER.DBF will be displayed in the preview. If you were to open the report, you would see that all the fields from CUSTOMER are included. If you check the expression, you will see that it does not include the alias, but the table listed in the popup at the bottom will be TEST. The expression evaluates to TRUE, which would lead you to believe that the fields actually all ended up in TEST. However, if you browse TEST, it will contain only the two fields specified.


Additional reference words: FoxWin 2.60 buglist2.60 fixlist2.60a relational
query by example database RQBE quick report
KBCategory: kbprg kbfixlist kbbuglist
KBSubcategory: FxtoolRqbe
Keywords : FxtoolRqbe kbbuglist kbfixlist kbprg
Version : 2.60
Platform : WINDOWS
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: October 20, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.