>>Hi All,
>>Myform has a private datasession with Mytable in it.
>>Main.prg creates the oApp object which inherits the
>>rptmgr object which has the rptexec method.
>>
>>Myform.RptBtn.click() has the following code:
>> oApp.rptmgr.rptexec("Mytable")
>>In oApp.rptmgr.rptexec() method, the line:
>> select (ctablename)
>>fails with "alias does not exist".
>>ctablename = "Mytable" according to debug.
>>
>>If I change form's datasession to 1-default it works OK.
>>
>>Or, leaving datasession 2-private, and I put:
>> use (ctablename)
>>in place of the select(ctablename) it works OK.
>>
>>The report called from .rptexec() can see the environment since, in the report, table2.fieldname works in the report where
>>table2 is also in the D/E.
>>
>>Why would the .rptexec() method not see the form's private datasession / data environment?
>>TIA
>
>Objects default to the datasession they were created in. You may need to pass a datasession id to your report object, or just have it always set it's data session to the _SCREEN.ActiveForm.DataSessionID.
How do I pass datasessionID to the report at runtime? I don't want to embed _screen.activeform.datasessionID in the report's data environment if possible.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only