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:
00981624
Vues:
34
Alexander,

hmm, try this (fast and dirty):
LOCAL oV1
oV1=CREATEOBJECT("_xsession")

REPORT FORM any_report


*********************************
DEFINE CLASS _xsession as custom
   PROCEDURE SetSession(liSessionID)
      SET DATASESSION TO liSessionID
   ENDPROC

   PROCEDURE any_method
      messagebox(STR(SET("DATASESSION"),11))
   ENDPROC

ENDDEFINE

**********************
* In Report's variables
Variable: xoV1
Initial Value: oV1.SetSession(SET("DATASESSION"))

* In Page header properties dialog
On Entry: ov1.any_method()
MartinJ

>Hi Martin,
>
>I need the Objects in the scope of report's private datasession! So the objects cannot be created before calling the report.
>
>Regards,
>
>Alexander
>
>>Hi Alexander,
>>
>>-or Cx00000005
>>
>>Create object before calling REPORT.
>>
>>MartinJ
>>
>>>Hello,
>>>
>>>are there any known issues about using the object references as report variables? I can't figure out what happens: I define a report variable oV1 as NewObject(cClass1, cLib) and reference it in report - it functions very good.
>>>
>>>As soon as I try to define another variable oV2 as NewObject(cClass2, cLib), I get
>>>
>>>- either the message "oV1 is not an object"
>>>- or "oV1 not found"
>>>- or " is not found on calling the method.
>>>
>>>either before the output of the report or after the first record has been printed.
>>>
>>>It is always the first object that causes the problem: if oV2 is the first in the list, it is the one that will be "not an Object" or "not found" etc. I have already experimented with all possible dummy-objects - it is always the same: the second object kills the first one.
>>>
>>>I thought, it had something to do with the datasessions - nothing of the kind, it doesn't matter, if the report runs in a default or in a private datasession.
>>>
>>>But as this particular report has to run in a private datasession, I wouldn't like to set private variables outside of it because the objects then do not see the tables inside the report's datasession.
>>>
>>>Thankful for any help
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform