Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
New Report Toolbar Not Accessible For TLF...
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
New Report Toolbar Not Accessible For TLF...
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00955429
Message ID:
00955429
Views:
69
When running in a Top Level Form, when I preview a report using VFP8 REPORT form syntax where SET REPORTBEHAVIOR is set to 90, the report is so modal even the report preview toolbar is not accessible. I am testing this under runtime conditions. Paste the code below into its own PRG file and run that PRG file. The code is complete so you have to do NOTHING but paste and run. Also, do this in its OWN FOLDER!

Please let me know if I am doing something wrong, and what your findings are. TIA!
*!*	
*!*	Put this code in its OWN FOLDER
*!*	Because files will be deleted
*!*	during its execution.
*!*	
LOCAL lcCode, lcFile
ERASE RepoDemo.*
ERASE CONFIG.FPW
SET RESOURCE ON
lcCode = GetReproCode()
lcFile = SYS(2005)		&& current resource file
STRTOFILE(lcCode, [RepoDemo.prg])
STRTOFILE([_screen=off] + CHR(13) + CHR(10), [config.fpw])
USE (lcFile) AGAIN IN 0 ALIAS crsFoxUser
CREATE REPORT RepoDemo FROM (lcFile)
CREATE PROJECT RepoDemo NOWAIT
_vfp.ActiveProject.Files.Add('RepoDemo.prg')
_vfp.ActiveProject.SetMain('RepoDemo.prg')
_vfp.ActiveProject.Close()
BUILD EXE RepoDemo FROM RepoDemo
USE IN SELECT('crsFoxUser')
RUN /n RepoDemo.EXE
RETURN


PROCEDURE GetReproCode
	LOCAL lcReproCode
	TEXT TO lcReproCode NOSHOW PRETEXT 2
		SET TALK OFF
		SET REPORTBEHAVIOR 90
		SET RESOURCE ON
		_screen.Visible = .F.
		LOCAL loTLF
		loTLF = CREATEOBJECT('_TLForm')
		loTLF.Show()
		READ EVENTS
		loTLF.Release()
		CLOSE TABLES ALL
		loTLF = NULL
		ON ESCAPE
		QUIT

		DEFINE CLASS _TLForm AS Form

			AutoCenter = .T.
			Height = 500
			Width = 600
			ShowWindow = 2
			WindowType = 0
			Caption = [Top Level Form - Double-Click in Form Area to get child form]
			Visible = .T.

			PROCEDURE DblClick
				LOCAL loForm
				loForm = CREATEOBJECT('_form')
				loForm.Show(1)
				THIS.Caption = [Top Level Form - Right-Click to CLEAR EVENTS]
			ENDPROC
			PROCEDURE RightClick
				CLEAR EVENTS
			ENDPROC

		ENDDEFINE
		DEFINE CLASS _Form AS Form

			AutoCenter = .T.
			Height = 400
			Width = 500
			DataSession = 2
			ShowWindow = 1
			Caption = [Form in TLF Form]

			ADD OBJECT cmdReport as _CommandButton WITH ;
				TOP = 100, ;
				LEFT = 200, ;
				Caption = 'Report'

			PROCEDURE Init
				SET TALK off
				SET DELETED on
				SET CENTURY on
				SET EXCLUSIVE off
				LOCAL lcFile
				lcFile = SYS(2005)
				IF FILE(lcFile)
					USE (lcFile) AGAIN IN 0 ALIAS crsFoxUser
				ELSE
					RETURN .f.
				ENDIF
				SELECT crsFoxUser
			ENDPROC
			PROCEDURE cmdReport.Click
				REPORT FORM RepoDemo TO PRINTER PROMPT PREVIEW
			ENDPROC

		ENDDEFINE
		DEFINE CLASS _CommandButton AS CommandButton

			Width = 80
			Height = 28
			FontBold = .T.

		ENDDEFINE
	ENDTEXT
	RETURN lcReproCode
ENDPROC
Mark McCasland
Midlothian, TX USA
Next
Reply
Map
View

Click here to load this message in the networking platform