Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Cursors in a report
Message
 
À
07/07/1998 12:54:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00114725
Message ID:
00115029
Vues:
23
>>>Thanks for the quick reply Evan. If I do create the SQL cursors in the init event of the DE, how can I set the relations with the main report table? For example, if the main report table has a user ID, and the CURSOR has a user ID and name, how do I set the relationship between the two so that the report shows the user name along with his ID?
>>>
>>
>>Your final cursor is "de-normalized" (so to speak). In your SQL statments you have associated the name with the id. Your report therefore uses only the data from one cursor, no joins are required.
>>
>>Example:
>>
>>select person.name, labtest.value;
>>from person, labtest;
>>where person.id = labtest.id;
>>into cursor pvalue
>>
>>Does that make sense?
>
>Mon,
> I am fairly new to VFP but, most people say to use views whenever possible. Parameratized views seems to be a new buz word. I have also used SQL statements to generate a query and then use field names only in the report. That way I can use different Querys and use only one report. In the report fields use for example cust instead of customers.cust for the data source.

James,

I use views when I can, but some of the SQL-selects get pretty huge a complex. There is no way I would want a nasty view like that hanging around. I use the same principle as you. I keep the field names the same as in the original tables. Gives a bit of reuse (a little bit).

The cool thing about putting the SQL statments in the dataenvironment is that you can actuall do a report preview during design.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform