Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Duplex Printing--Supported?
Message
De
18/01/2013 12:57:07
 
 
À
17/01/2013 17:39:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
01563193
Message ID:
01563288
Vues:
85
J'aime (1)
>Does VFP 9 support duplex printing?
>My client would like to print something on one side of the paper, then something else on the other side.
>Of course, the printer would have to support duplex printing.
>Is this possible with VFP?
>
>The client does not want to print the whole stack of reports, then flip the paper over, put it back in the printer, and print the other side.
>
>Thanks, Chaim
Hi,

The functionality where the client does not need to flip over the paper by hand in orde to print the other side, is printer related and cannot be controlled by VFP.
On the other hand, for those customers, who do not have such an elaborate printer but still would like to print duplex and are willing to insert the paper back into the tray, turned ofcourse, you can make a routine in VFP9SP2 provided you use Reportbehavior 90 which stops after printing the odd pages before it prints the even pages - which is what duplex is doing-
Function OddEven
Parameters tcReport, tcOddEven

Select curReport

Go Top
Set ReportBehavior 90
loOddEvenListener = Newobject("OddEvenListener")
loOddEvenListener.ListenerType	= 1   &&Preview
loOddEvenListener.icWhatToPrint = Upper(tcOddEven)

Report Form (m.tcReport) Object loOddEvenListener

Define Class OddEvenListener As UpdateListener Of "_reportlistener.vcx"

	icWhatToPrint = Upper(m.tcOddEven)

	Function IncludePageInOutput
		Lparameters tnPageNo
		Do Case
			Case tcOddEven = "ALL"
				Return .T.
			Othe
				Return (m.tnPageNo%2=1 And This.icWhatToPrint = "EVEN") Or (m.tnPageNo%2 = 0 And This.icWhatToPrint="ODD")
		Endcase
Enddefine
In your call Report to Print function you write:
If This.Parent.chkOddEven.Value = .T.  &&  a checkbox to control the PrintOddEven functionality

	m.lcMessage = "Print odd - pages"
	m.lcMessageCaption = "Make choice"
	m.lnAnswer = Messagebox( m.lcMessage, 3+32+0+0, m.lcMessageCaption, 0 )  &&  Yes = 6, No = 7
	Do Case
		Case m.lnAnswer = 2 && Cancel
		Case Inlist(m.lnAnswer, 6, 7)
			m.llRet = .T.
	Endcase

	m.lcMessageCaption = "Please insert paper again"

	Do Case

		Case  m.llRet = .T. And m.lnAnswer = 6

			m.lcChoice = "ODD"
			Do printoddeven With m.lcReport, m.lcChoice

			m.lcPages = Alltrim(Transform(_Pagetotal))
			m.lcMessage = "Odd pages printed ?"+Chr(9)+Chr(13)+"(total "+m.lcPages+" pages )"

			m.lnReady = Messagebox( m.lcMessage, 3+32+0+0, m.lcMessageCaption, 0 )  &&  Yes = 6, No = 7
			If m.lnReady = 6
				m.lcChoice = "EVEN"
			Endif

		Case m.llRet = .T. And m.lnAnswer = 7
			m.lcChoice = "EVEN"
			Do printoddeven With m.lcReport, m.lcChoice
			m.lcMessage = "Even pages printed ?"
			m.lnReady = Messagebox( m.lcMessage, 3+32+0+0, m.lcMessageCaption, 0 )  &&  Yes = 6, No = 7
			If m.lnReady = 6
				m.lcChoice = "ODD"
			Endif
		Case m.lnAnswer = 2
	Endcase
Else
	m.lcChoice = "ALL"

	If !Vartype (_Screen.oFoxPreviewer) = 'O'
		Do FoxyPreviewer.App
	Endif

	With _Screen.oFoxyPreviewer
		.cTitle = Proper(Juststem(m.lcReport))
		Report Form (m.lcReport) Preview
	Endwith

Endif
Regards,

Koen
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform