Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wrong cursor selected
Message
From
21/07/2003 14:10:54
Dennis Schuette
Customized Business Services, Llc
Yuma, Arizona, United States
 
 
To
21/07/2003 13:55:54
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00812082
Message ID:
00812091
Views:
11
>>I am using VFP 5.0a. The report uses the wrong cursor the first time the report is printed, but each time thereafter it uses the correct cursor.
>>
>>To debug, I placed a messagebox in the following DE code events to try to find out when the cursor gets switched (they execute in the following order):
>>OpenTables() && reports correct cursor
>>BeforeOpenTables() && reports correct cursor
>>Init() && reports correct cursor
>>
>>Sequence of events:
>>1] In a PageFrame I have a grid and a commandbutton (cmdPrint).
>>2] I select a row in the grid.
>>3] I click the cmdPrint that creates the cursor 'curReport' used in the report.
>>4] The report is called.
>>5] The first time, the report uses a cursor 'tempSort' that was previously opened. (If I close 'tempSort', the report works fine the first time, but other parts of the pageframe depend on it being open.
>>6] The second time, the report uses 'curReport' correctly.
>>
>>I saw some discussion in UT about using a grid. The suggestion was to SetFocus() to something other than the grid. So in the cmdPrint.Click() I have a line: 'This.SetFocus()' [I know this is redundant, but I'm willing to try anything!].
>>
>>I also searched Visual SourceSafe for any occurance of 'tempSort' in the report, and found no reference. I even opened up the .FRX and looked in every field - 'tempSort' is not referenced.
>
>Hi Dennis,
>
>You've probably looked at this already, but is there anything at all in the Report's Data Environment? What happens if you put a breakpoint on USED("TempSort")?

Cindy,
Thanks for responding so quickly.

My DE is empty.

Your suggestion of setting a breakpoint on USED("TempSort") would always return .t. since it is supposed to be open. I tried setting a breakpoint on Alias() just before the report was called, but it did not change until after the report preview was closed. It still used the wrong cursor. Below in the code that immediately preceeds calling the report:

select curReport
index tag curReport on RType+ltrim(Str(lot))
go top
report form receiving to printer prompt preview noconsole
Dennis Schuette
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform