Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to Move Record pointer in Report
Message
From
24/02/2000 00:25:49
 
 
To
24/02/2000 00:12:08
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00336561
Message ID:
00336567
Views:
17
Rick,

>I have a report that pulls data from a temporary cursot that gets built on the fly with a sql statement. The cursor is called tempcur.
>
>One of the fields in the detail band of my report has the following express oApp.GetBval(). GetBval is a method of my application object that that returns a numerical value. To do this, in the method I'm doing a seek in another table based on the value in tempcur.cust_id.

If the only purpose for GetBval() is to pull the numeric value from another table according to the value of tempcur.cust_id, and it does not have to manipulate or calculate anything, you can just include the other table field in your SQL SELECT statement using a JOIN or WHERE clause to relate the two tables together.

Your resulting temporary cursor will then have the numeric value included in it. For example:
SELECT table1.*, table2.numfield ;
  FROM table1 INNER JOIN table2 ;
    ON table1.cust_id = table2.cust_id ;
  INTO CURSOR tempcur
The inner join assumes that you have a record in table2 matching every cust_id in table1. If not, you may want a LEFT OUTER JOIN.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform