Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unknown Member
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Unknown Member
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01443305
Message ID:
01443305
Vues:
137
Hi Gang!

I added 2 new Command Buttons in the PRG below....
FUNCTION SELPRINT
PARAMETER mOnLine, mExport

IF NOT mOnLine
	SET PRINTER TO NAME (alltrim(_report_prt))
	RETURN 1
ENDIF

PUSH KEY CLEAR
ON KEY LABEL ESC oform.cmdCancel.CLICK

PUBLIC mChoice, mTemp
PUBLIC oform
oform=CREATEOBJECT("form1")
oform.SHOW(1)

ON KEY LABEL ESC
POP KEY

RETURN mChoice

DEFINE CLASS form1 AS FORM
	AutoCenter = .T.
	WindowType = 1
	Height = 200	&& 158
	Width = 400
	Caption = "Printer Dialog"
	Name = "Form1"
	DIMENSION aprintarray[1]

ADD OBJECT combo1 AS COMBOBOX WITH ;
	BOUNDTO = .F., ;
	ROWSOURCETYPE = 5, ;
	ROWSOURCE = 'THISFORM.aprintarray', ;
	HEIGHT = 25, ;
	LEFT = 50, ;
	STYLE = 2, ;
	TOP = 40, ;
	WIDTH = 300, ;
	NAME = "Combo1", ;
	TABINDEX = 6

ADD OBJECT cmdPrint AS COMMANDBUTTON WITH ;
	TOP = 100, ;
	LEFT = 50, ;
	HEIGHT = 27, ;
	WIDTH = 84, ;
	CAPTION = "\<Print Report", ;
	DEFAULT = .T., ;
	NAME = "cmdPrint", ;
	TABINDEX = 1

ADD OBJECT cmdPreview AS COMMANDBUTTON WITH ;
	TOP = 100, ;
	LEFT = 158, ;
	HEIGHT = 27, ;
	WIDTH = 84, ;
	CAPTION = "Pre\<view", ;
	NAME = "cmdPreview", ;
	TABINDEX = 2

ADD OBJECT cmdCancel AS COMMANDBUTTON WITH ;
	TOP = 100, ;
	LEFT = 266, ;
	HEIGHT = 27, ;
	WIDTH = 84, ;
	CANCEL = .T., ;
	CAPTION = "\<Cancel", ;
	NAME = "cmdCancel", ;
	TABINDEX = 3


->>  HERE ARE THE TWO NEW COMMAND BUTTONS....


*TMT 01/11/10 Added the Export as Spreadsheet button
ADD OBJECT cmdExportAsSpreadsheet AS COMMANDBUTTON WITH ;
	TOP = 150, ;
	LEFT = 62, ;
	HEIGHT = 27, ;
	WIDTH = 125, ;
	CAPTION = "Export \<Spreadsheet", ;
	NAME = "cmdExportAsSpreadsheet", ;
	TABINDEX = 4

*TMT 01/11/10 Added the Export as Textfile button
ADD OBJECT cmdExportAsTextfile AS COMMANDBUTTON WITH ;
	TOP = 150, ;
	LEFT = 213, ;
	HEIGHT = 27, ;
	WIDTH = 125, ;
	CAPTION = "Export \<Textfile", ;
	NAME = "cmdExportAsTextfile", ;
	TABINDEX = 5

-->>

PROCEDURE Load
	LOCAL lnI
	mTemp = 0

	FOR lnI = 1 TO APRINTERS(THISFORM.aprintarray)
		*   Note below that you are adding a leading space. This
		*   prevents a network printer in Windows NT from appearing
		*   disabled in the combo due the leading "\"
		
			IF THISFORM.aprintarray[lnI,1] = ALLTRIM(REGCONFG.REPORT_PRT)
				mTemp = lnI
			ENDIF

			THISFORM.aprintarray[lnI,1] = ' ' + THISFORM.aprintarray[lnI,1]
	ENDFOR
	THISFORM.REFRESH
ENDPROC


PROCEDURE combo1.INIT
	THISFORM.COMBO1.VALUE = THISFORM.aprintarray[mTemp,1]
	THIS.Requery()
	THISFORM.REFRESH
	
*TMT 01/11/10 Add check to Enable or Disable the Export buttons....
	IF mExport
		Thisform.cmdExportAsSpreadsheet.Enabled = .T.
		Thisform.cmdExportAsTexfile.Enabled = .T.
	ELSE
		Thisform.cmdExportAsSpreadsheet.Enabled = .F.
		Thisform.cmdExportAsTexfile.Enabled = .F.
	ENDIF 
ENDPROC

PROCEDURE cmdPrint.CLICK
	SET PRINTER TO NAME (ALLTRIM(THISFORM.combo1.VALUE))
	mChoice = 1	
	RELEASE THISFORM
ENDPROC


PROCEDURE cmdPreview.CLICK
	mChoice = 2
	RELEASE THISFORM
ENDPROC


PROCEDURE cmdCancel.CLICK
	mChoice = 0
	RELEASE THISFORM
ENDPROC

*TMT 01/11/10 Added the Export as Spreadsheet button
PROCEDURE cmdExportAsSpreadsheet.CLICK
	mChoice = 3
	RELEASE THISFORM
ENDPROC

*TMT 01/11/10 Added the Export as Textfile button
PROCEDURE cmdExportAsTextfile.CLICK
	mChoice = 4
	RELEASE THISFORM
ENDPROC

ENDDEFINE
When I run the code, get an error on the above new command buttons....

"Unknown Member 'cmdExportAsSpreadsheet"

and

"Unknown Member 'cmdExportAsTextfile'"

when the code gets to the code
*TMT 01/11/10 Add check to Enable or Disable the Export buttons....
	IF mExport
		Thisform.cmdExportAsSpreadsheet.Enabled = .T.
		Thisform.cmdExportAsTexfile.Enabled = .T.
	ELSE
		Thisform.cmdExportAsSpreadsheet.Enabled = .F.
		Thisform.cmdExportAsTexfile.Enabled = .F.
	ENDIF 
ENDPROC
What am I overlooking?

Thanks!
Tommy Tillman A+ NetWork+ MCP
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform