Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP 9 Report Listener - Error Loading Printer Driver
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
VFP 9 Report Listener - Error Loading Printer Driver
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01135998
Message ID:
01135998
Vues:
211
I receive the error 'Error Loading Printer Driver' when using the custom Report Listener in PREVIEW mode and the user clicks the print button on the preview toolbar.

The error does not occur when using the standard VFP preview mode or when printing directly.

The code I am testing (listed below) is a sample from fox.wikis.com. I created a very simple report form called test.frx without saving the printer environment for use by the example.
CREATE CURSOR test (cdata char(20))
APPEND blank
*Modeled after sample code at http://fox.wikis.com/wc.dll?Wiki~ReportListener~VFP 
*...
*Code to instantiate the listener object and run the report.
#INCLUDE reportlisteners.h
Set Classlib To Home()+"\ffc\_reportlistener.vcx" additive

#DEFINE DebugListener -2
#DEFINE PrintListener 0
#DEFINE PreviewListener 1
#DEFINE XMLListener 4
#DEFINE HTMLListener 5

#DEFINE PreviewMode '1'
#DEFINE PrintMode '2'

**Custom Listener
Local oListener as object
oListener = NEWOBJECT("ltListener")
oListener.ListenerType = PreviewListener 

***Run Report
REPORT FORM "test.frx" TO PRINTER PROMPT OBJECT olistener

RETURN

*+------------------------------------------------------
*| Custom Listener Class named: "ltListener"
*+------------------------------------------------------
DEFINE CLASS ltListener AS utilityreportlistener
************* Instance Specific Properties

	*+---------------------------------------------------------
	*| *** Parent Method Customizations ***
	*+---------------------------------------------------------
	*+---------------------------------------------------------
	*| Error() **Inherited Method
	*| Triggered when an Error occurs while running the report.
	*+---------------------------------------------------------
	Procedure Error(nError, cMethod, nLine)
		DoDefault(nError, cMethod, nLine)
		Set Step On
	ENDPROC

	*+---------------------------------------------------------
	*| OnPreviewClose() **Inherited Method
	*| Triggered when an Error occurs while running the report.
	*+---------------------------------------------------------
	Procedure OnPreviewClose(lPrint)
		IF lPrint	&& User clicked Print button!
			*** Set variable flag here, or whatever
			WAIT WINDOW "It's rollin', baby!"
		ENDIF
		DoDefault(lPrint)
	ENDPROC
ENDDEFINE
Aubrey
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform