Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object Variables in reports
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
00981329
Message ID:
00986394
Vues:
40
Whatever is wrong, it has nothing to do with your having a private data session *or* two variables, AFAICS.

FWIW Martin is right, you can get objects to participate in your private datasession without their having been "born" in it. But it can be tricky to manage properly, and if you want to create the objects within your session, you should be able to do so.

Here is what I did to verify that it is *not* what you say that is causing the crash:

* set up a quick report

* created two report variables, myobj1, and myobj2

* set the initial value of myobj1 to newobject("textbox")

* set the initial value of myobj2 to newobject("checkbox")

* set the value-to-store of myobj1 to myobj1, and myobj2 to myobj2

* set up a private datasession for the report

* set the following expression for the OnEntry of the detail band:

execscript("wait window timeout 1 myobj1.baseclass")

* set the following expression for the OnExit of the detail band:

execscript("wait window timeout 1 myobj2.baseclass")

* included the following line in the AfterCloseTables event (probably not necessary but seemed like a good idea <g>):


STORE null TO myobj1, myobj2


* previewed the report from the Designer. Also ran the report from the command line and a PRG. Tried with both SET REPORTB 80 and 90.

Result: alternating WAIT WINDOWs as expected, and no crashes.

Before you say it's because I was using Fox baseclasses... I really doubt that, because I create objects in the context of a report (such as template classes from which to take dynamic reporting attributes) quite often. True, they are not usually assigned to report variables; sometimes I make them member properties of the DE, actually. But I think you are probably seeing some sort of scoping problem. It's also possible that you're trying to reference them at a time that the private datasession no longer exists, I suppose.

>L<
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform