Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reports showing only......
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01316516
Message ID:
01316967
Views:
10
>So here is the code I am using and calling up the report from a command button for now do not know a better way yet, anyway here goes.
>
>
>SELECT strain, quantity, location2, userid, date, notes ;
>	FROM Veg ;
>	ORDER BY strain ASC, date DESC ;
>	INTO CURSOR strainreport
>SELECT strainreport
>REPORT FORM report1cutt.frx  TO PRINTER  PROMPT  PREVIEW
>USE   && closes the cursor
>SELECT Veg
>USE   && closes the table
>
>What happens with this code is the report gets pulled up but it does not sort date descending and if I leave the last 2 lines of code in this snippet I get the error after closing the report preview Alias Veg is not found. It finds Veg in the beginning of the code but not at the end.
>
>Thanks,
>
>Fred W.


I agree with the others that have suggested that your 'problem' is that the data enviroment has the Veg table in it. Removing the aliases from the field names is also important.

Right click anywhere on the report and choose 'Data Environment' from the popup menu. If there are any tables in that window, left click once on the title/header of the table, and then press the delete key. Once any/all tables have been deleted close the data environment window and then save and close the report.

Another helpful tool for this kind of situation is data session window. You turn it on from the menu or the toolbar, and while you run this code, you'll be able to see the table(s) that is/are open(ed) and the cursor(s) that is/are created and deleted.

HTH,
Randy Bosma
VFP - Because life is too short to code in something else...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform