Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unable to close form after report preview
Message
 
 
To
19/03/2000 11:30:16
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00347606
Message ID:
00347622
Views:
14
John,
I dont know if anyone has an explanation, but a preview with forms open sometimes leads to some bizaar stuff.

I worked aroung the problem by writing two procedures that hide/restore all opens forms. I use hide_forms/restore_forms before/after any REPORT FORMAT *****.FRX PREVIEW.

The PUBLIC ARRAY stuff can be replaced by a property of a form, formset, custom class, whatever...

Hope This Helps,


ED


***************************************************************************
PROCEDURE hide_forms
PRIVATE indx, indx2, scrncnt

scrncnt = 0
FOR indx = 1 TO _SCREEN.FORMCOUNT
* A simple form
IF TYPE('_SCREEN.Forms(indx).Formcount') <> 'N'
scrncnt = scrncnt + 1
PUBLIC ARRAY openforms[scrncnt,2]
openforms[scrncnt,1] = _SCREEN.Forms(indx)
openforms[scrncnt,2] = _SCREEN.Forms(indx).Visible
_SCREEN.Forms(indx).Visible = .F.
ELSE
* A formset
FOR indx2 = 1 TO _SCREEN.Forms(indx).Formcount
scrncnt = scrncnt + 1
PUBLIC ARRAY openforms[scrncnt,2]
openforms[scrncnt,1] = _SCREEN.Forms(indx).Forms(indx2)
openforms[scrncnt,2] = _SCREEN.Forms(indx).Forms(indx2).Visible
_SCREEN.Forms(indx).Forms(indx2).Visible = .F.
ENDFOR
ENDIF
ENDFOR

***************************************************************************
PROCEDURE restore_forms
PRIVATE indx, objref

FOR indx = 1 TO ALEN(openforms,1)
objref = openforms[indx,1]
objref.Visible = openforms[indx,2]
openforms[indx,1] = NULL
ENDFOR

PUBLIC ARRAY openforms[1]
Ed Aguinaga
ARIS, Inc
ed@arismls.com
Previous
Reply
Map
View

Click here to load this message in the networking platform