Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting a Printer Prompt in VFP9
Message
 
 
To
02/03/2005 14:44:25
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00991661
Message ID:
00993378
Views:
27
>
>|| I gues I'm missing something but the print preview
>|| toolbar works for me w/o NOWAIT clause.
>|
>| Try it in runtime and a top level form.
>

>
>Mark, I'm pretty sure there is a hard-to-pin-down-precisely bug in VFP9 to do with modal windows and the overall window stack that is highlighted "nicely" by the default ReportPreview app, resulting in the toolbar becoming inaccessible.
>
>I remember that we saw this late in the development cycle. If you can develop a simple set of steps to reproduce, you should post them to MSFT using the official bug report mechanism. There's a good chance this could be fixed in an SP1 version...

Here is repro code. Just paste and run from a PRG file. No need to compile into an EXE. If I have missed something, let me know. If it is a bug, then I will report accordingly. Thanks.
#DEFINE USE_OBJECT_TYPE .f.
SET REPORTBEHAVIOR 90
LOCAL loTLF
loTLF = CREATEOBJECT('_TopLevelForm')
loTLF.Show()
READ EVENTS
loTLF = NULL
RETURN

DEFINE CLASS _TopLevelForm AS FORM

	ShowWindow=2
	Top = 0
	Left = 0
	Height = 500
	Width = 600
	
	PROTECTED PROCEDURE Init
		SET TALK off
		SET EXCLUSIVE off
		SET MULTILOCKS on
		SET DELETED on
		OPEN DATABASE HOME() + [Samples\Northwind\Northwind]
		SET DATABASE TO Northwind
		BINDEVENT(THIS, 'Show', THIS, 'RunReport', 1)
	ENDPROC
	PROTECTED PROCEDURE Unload
		CLOSE ALL
		CLEAR EVENTS
	ENDPROC
	PROTECTED PROCEDURE Destroy
		IF FILE('nwcust.frx')
			ERASE nwcust.frx
		ENDIF
		IF FILE('nwcust.frt')
			ERASE nwcust.frt
		ENDIF
		CLOSE ALL
	ENDPROC
	PROTECTED PROCEDURE Error(nError, cMethod, nLine)

	ENDPROC
	PROCEDURE RunReport
		LOCAL lcReport
		lcReport = [NWCust]
		USE Northwind!Customers
		CREATE REPORT &lcReport FROM Customers
		IF USE_OBJECT_TYPE
			REPORT FORM &lcReport OBJECT TYPE 1 TO PRINTER PROMPT
		ELSE
			REPORT FORM &lcReport TO PRINTER PROMPT PREVIEW
		ENDIF
		WAIT WINDOW 'The Report preview window is modal regardless of the value of the USE_OBJECT_TYPE constant. Hit Enter to Continue...'
	ENDPROC
ENDDEFINE
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform