Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class Method in Report
Message
From
10/04/2008 13:50:26
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01309629
Message ID:
01309757
Views:
4
>>>>Hi,
>>>>
>>>>Is it possible to use a class method as the expression for a report field?
>>>>I guess I'm really just asking how/whether one can instantiate a class object in the report?
>>>>TIA,
>>>>Viv
>>>
>>>Sorry if this is already answered. You need to instantiate your class object in the program/form calling the report, then you would be able to use its methods.
>>>
>>>Alternatively you can create a public variable in Report's DE Init (or OpenTables ?) method and release it in Report's DE destroy. But if you have control of the calling form/program, I believe the first is the better choice.
>>
>>Not sure about that. In some ways I like the DE solution better in that it works at design time without my having to remember to instantiate the object in question.
>>Regards,
>>Viv
>
>I'm wondering if you can create this variable using _VFP.SetVar('myObject',newobject()) (inside IIF condition). It this idea works, you would not need to use Report's DE and public vars.

Too many options! In the end I went for the DE solution for the reasons given above. If I was likely to be using this in future I'd think a bit more about the pros and cons of each suggestion - but this is just a quick one-off addition. Must admit though that it's pretty much the first time I've used a PUBLIC var in years!
Thanks to all,
Viv
Previous
Reply
Map
View

Click here to load this message in the networking platform