Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reports using the form's DE: problems with SET SKIP
Message
From
03/08/1999 10:14:09
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
03/08/1999 09:51:25
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00249196
Message ID:
00249213
Views:
22
>This is the latest installment of my experiments in sharing the data environment of a form and a report, which takes advantage of any filters applied to the table. In my last query, I asked why a 1:M report only displayed the first child record. The answer involved using SET SKIP to force the report to see the child table as a 1:M relation. Here's part of the sample code I posted at that time:
>
>
>*-- imNeg is the parent of imPrint, in a 1:M relationship
>
>public vFPtr
>
>*-- open form with reference pointer, move to form's DS
>do form forms\imnegfrm name vFPtr linked
>set datasession to vFPtr.datasessionid
>
>* -- now let the report use the form's data environment
>select imNeg
>set skip to imPrint    && allow multiple children in report
>report form reports\imrel_r1 preview
>set skip to            && preserve normal behavior in form
>*-- control returns to form
>
>
>This works correctly when the full report is printed. But if I try to print only one record, using:
>
>
>report form reports\imrel_r1 next 1 preview
>
>
>only the first child record is displayed. My guess is that the problem is caused by the fact that the record pointer hasn't moved since SKIP was reset. But my experiments to correct the problem haven't been successful. Does anyone have suggestions?
>
>On the broader question of whether I should be doing this in the first place, I'm coming around to the answer "probably not". But rewriting the whole thing in terms of queries and cursors is going to take some time, and I still will want to share the form and report DE's when possible, to save the time of a separate report query.
>
>Thanks for any enlightenment on these issues.
>
>BEW
Barbara,
Instead of next 1 use a while clause. ie:
m.PKValue = PKValue
report form reports\imrel_r1 while PKVlaue = m.PKValue preview
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform