David,
Thanks! Just another question though, for the longest time I really thought it wasn't advisable to use the DE of a report. I usually have make a form that accepts the parameters needed, then use these to create or prepare the data before I run REPORT FORM.
Am I doing it the hard way?! Or am I better off using the DE of a report?
Will the DE Init fire even if no tables were dropped into it?
Thanks
Dennis
>Dennis,
>
>>How to do that?
>
>open the data environment of the report:
>
>
>*report.DE.Init()
>set procedure to myreportclass additive
>public goReport
>
>goReport = createobject( "myclass" )
>
>*report.DE.destory method:
>
>goReport = .null.
>release goReport
>
>* myreportclass.prg
>define class myclass as Custom
>iProp = 1
>
>function init()
>debugout program()
>endfunc
>
>function destroy()
>debugout program()
>endfunc
>
>function Increment()
>this.iProp = this.iProp + 1
>return str( this.iProp )
>
>function test()
>
>return str( x1.i1 * 2 )
>
>enddefine
>
>
>the x1 cursor gets created in the report's private DS, the object has access to the cursor in the test() method for example. You can drop fields onto the report and make their expressions like goReport.Increment() or goReport.Text().