Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: naveed ahmad
  Where is naveed ahmad?
 peshawar
 Pakistan
 naveed ahmad
 Tags
Subject: RE: how to use cursor at dataenvirnoment
Thread ID: 396038 Message ID: 396039 # Views: 49 # Ratings: 2
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Wednesday, January 22, 2014 1:17:19 PM         
   


> hi Expert
> how to use cursor at data environment , i mean when i select some data from any table like this
>
> select * from table1 where date = date() into cursor my_table
>
> now i want to use cursor my_table for view reports and print report also.
> please guide me.
> thanks
> best regards



When you can create the "Select .. Into Cursor ..." cursor, it would be available as an alias, named "my_table" in your case, in the current Data Session.
So that if you want to "Report Form ... [Preview]", you'd just need to make sure it's the currently selected alias, AKA "work area".

The Form.DataEnvironment of the currently active form (if any) would not care much about the new alias, the only relation among those two concepts would be that when the current Data Session is getting closed, for example by doing a "Thisform.Release()" while Thisform.DataSession=2, "private data session", all aliases would get closed too, no matter whether they belong to the Form.DataEnvironment or not.

If on the other hand your question rather is Can I use myCursor in the Report Designer's "Data Environment" window, then the answer would be No, instead you would set the report "fields" properties manually if the data source is a temporary cursor




hth
-Stefan

ENTIRE THREAD

how to use cursor at dataenvirnoment Posted by naveed ahmad @ 1/22/2014 1:06:11 PM
RE: how to use cursor at dataenvirnoment Posted by Stefan Wuebbe @ 1/22/2014 1:17:19 PM
RE: how to use cursor at dataenvirnoment Posted by naveed ahmad @ 1/22/2014 1:31:53 PM