DeCiacco
2005-10-18 15:45:30 UTC
I have two top level forms, FormA and FormB. FormA gets the data in the proper
cursors and then calls FormB to display a preview of the report which uses the
cursors opened by FormA. FormA uses a private datasession and FormB uses the default
datasession. When FormB comes up it "shares" FormA's datasession. FormB has the
necessary components to display the preview and it works great, however....
This is the Init() event of FormB:
LOCAL numofrecs as Integer
WITH THISFORM
IF VARTYPE(.oListener) = 'O'
.oListener.ONPREVIEWCLOSE()
ENDIF
.oListener = CREATEOBJECT("ReportListener")
.oListener.LISTENERTYPE = 3
SELECT curzipdistrib
COUNT TO numofrecs
IF numofrecs > 0 THEN
SELECT curcensusmain
REPORT FORM distribution.frx OBJECT .oLISTENER nopageeject
SELECT curzipdistrib
REPORT FORM zipdistrib.frx OBJECT .oLISTENER
ELSE
SELECT curcensusmain
REPORT FORM distribution.frx OBJECT .oLISTENER
ENDIF
THISFORM.DisplayPage()
ENDWITH
When I close FormB the Datasession names turns to Unknown(2). This is by design. When
I close FormA the Unknown(2) session should also close. I know this because I created
a test app and it ended works. The session is not be released because there is
something still referencing it. What I've discovered is that if I don't use the
NOPAGEEJECT as shown above, but just display my first report, then Unknown(2) closes
fine when I close FormA. So I know that it has something to do with NOPAGEEJECT. I'm
not sure what it is. I thought it was the CommandClauses object that gets created in
the report listener not being properly destroyed, but I tried to explicitly set it to
.NULL. right before setting my ReportListener object to .NULL., but that did nothing.
It is my understanding that by setting the reference to the object to .NULL. the
object gets destroyed, although it doesn't make sense. At the same time there is no
other way to destroy an object who's reference is a property in a form. In other
words, I can't do RELEASE thisform.oListener.
Does anyone have any idea why Unknown would not get released if nopageeject is used?
Thanks.
cursors and then calls FormB to display a preview of the report which uses the
cursors opened by FormA. FormA uses a private datasession and FormB uses the default
datasession. When FormB comes up it "shares" FormA's datasession. FormB has the
necessary components to display the preview and it works great, however....
This is the Init() event of FormB:
LOCAL numofrecs as Integer
WITH THISFORM
IF VARTYPE(.oListener) = 'O'
.oListener.ONPREVIEWCLOSE()
ENDIF
.oListener = CREATEOBJECT("ReportListener")
.oListener.LISTENERTYPE = 3
SELECT curzipdistrib
COUNT TO numofrecs
IF numofrecs > 0 THEN
SELECT curcensusmain
REPORT FORM distribution.frx OBJECT .oLISTENER nopageeject
SELECT curzipdistrib
REPORT FORM zipdistrib.frx OBJECT .oLISTENER
ELSE
SELECT curcensusmain
REPORT FORM distribution.frx OBJECT .oLISTENER
ENDIF
THISFORM.DisplayPage()
ENDWITH
When I close FormB the Datasession names turns to Unknown(2). This is by design. When
I close FormA the Unknown(2) session should also close. I know this because I created
a test app and it ended works. The session is not be released because there is
something still referencing it. What I've discovered is that if I don't use the
NOPAGEEJECT as shown above, but just display my first report, then Unknown(2) closes
fine when I close FormA. So I know that it has something to do with NOPAGEEJECT. I'm
not sure what it is. I thought it was the CommandClauses object that gets created in
the report listener not being properly destroyed, but I tried to explicitly set it to
.NULL. right before setting my ReportListener object to .NULL., but that did nothing.
It is my understanding that by setting the reference to the object to .NULL. the
object gets destroyed, although it doesn't make sense. At the same time there is no
other way to destroy an object who's reference is a property in a form. In other
words, I can't do RELEASE thisform.oListener.
Does anyone have any idea why Unknown would not get released if nopageeject is used?
Thanks.