Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inconsistencies with running method from report
Message
 
À
03/01/2000 22:12:38
Chris Crachiolo
Blackmoor Associates Incorporated
New York City, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00312074
Message ID:
00312963
Vues:
34
Sounds like your report has a private datasession. Check that and change it to Default. Then it will see the private variables on the calling form.

Barbara

>I've tried declaring the variables in a number of different places, with no change in resulting behavior. Thanks for your input, though.
>
>
>>Christopher,
>>Either set these public variables in the form before the report is called (assuming the report doesn't have a private datasession) or else set them in the Report INIT() method. To put code in the Report INIT(), open the report DataEnvironment, right click and choose "Properties". You'll see a property sheet for the report that you can use.
>>
>>Also, if the report does NOT have a private datsession, you can set PRIVATE variables in the calling form and they will be visible in the report.
>>
>>HTH
>>Barbara
>>
>>>A form launches a report; the form has a method that is called by the report, i.e., a report variable is defined that's reset at the data grouping "RECNO()" and both the "value to store" and "initial value" contain "THISFORM.MyMethod()". The report variable itself is just a dummy, and the method returns an empty string. The actual work done by the method involves assigning values to PUBLIC variables (yeah, I know -- bad idea -- but they only exist during printing -- I'm making sure they're released -- and nothing else is going to happen while printing anyway). These public variables consist of one array and some other non-array variables.
>>>
>>>If I print the report for a scope of one record, everything is fine. However, if the scope is more than one record, the public variables appearing (or influencing output on) the report for subsequent records contain the values for the PREVIOUS record (I've actually confirmed this only for some of the variables) -- EXCEPT for the public array, which is always correct.
>>>
>>>It's obviously something happening during the report processing, since as a test I ran the method code from a SCAN loop instead of REPORT FORMing, and watched the variables during execution with the debugger -- the values were always fine, regardless of the record scope.
>>>
>>>I can work around this by REPORTing only one record at a time (each record appears on a separate page anyway), but ....
>>>
>>>Any ideas? Or is trying to do too much behind the scenes during REPORTing just a bad idea?
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform