Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Print the paper of 2 sides
Message
De
01/08/2010 14:34:34
 
 
À
01/08/2010 12:11:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01474796
Message ID:
01474810
Vues:
52
>hi all,
>
>
>i want the printer to print the paper of 2 sides on A4 size via title band or sutable way
>
>the table have
>field 1 type memo&&have characters fill the a4 page(as a contract) side 1
>field 2 type memo&&have characters fill the a4 page......................side2
>
>thanks

Hi,

when you are using Reportbehavior 90 you could consider to make use of following function:
* PrintOddEven
Parameters tcReport, tcOddEven
Select curReport

Go Top
Set ReportBehavior 90

loOddEvenListener = Newobject("OddEvenListener")
loOddEvenListener.ListenerType	= 1   &&Preview
loOddEvenListener.icWhatToPrint = Upper(tcOddEven)

Report Form (tcReport) Object loOddEvenListener

Define Class OddEvenListener As UpdateListener Of "_reportlistener.vcx"

	icWhatToPrint = Upper(tcOddEven)

	Function IncludePageInOutput
		Lparameters tnPageNo
		Do Case
			Case tcOddEven = "ALL"
				Return .T.
			Othe
				Return (tnPageNo%2=1 And This.icWhatToPrint = "EVEN") Or (tnPageNo%2 = 0 And This.icWhatToPrint="ODD")
		Endcase
Enddefine
And in your printing class, when calling your report you should have:
** your form had a property chkOddEven  default .t.
lcReport = "YourReport.frx"     &&& change to your report or call  it via a parameter your option
	
	thisform.PrepareCurreport(lnReportSelect)  ** or what ever to prepare your cursor for the report.
		if this.parent.chkOddEven.value = .t.
				
			lcMessage = "Print odd - pages"
			lcMessageCaption = "Make choice"
			lnAnswer = messagebox( lcMessage, 3+32+0+0, lcMessageCaption, 0 )  &&  Yes = 6, No = 7
			do case
				case lnAnswer = 2 && Cancel
				case inlist(lnAnswer, 6, 7)
					llRet = .t.
			endcase

			lcMessageCaption = "Please insert paper again"

			do case

				case  llRet = .t. and lnAnswer = 6

					lcChoice = "ODD"
					do printoddeven with lcReport, lcChoice

					lcPages = alltrim(transform(_pagetotal))
					lcMessage = "Odd pages printed ?"+chr(9)+chr(13)+"(total "+lcPages+" pages )"

					lnReady = messagebox( lcMessage, 3+32+0+0, lcMessageCaption, 0 )  &&  Yes = 6, No = 7
					if lnReady = 6
						lcChoice = "EVEN"
					endif

				case llRet = .t. and lnAnswer = 7
					lcChoice = "EVEN"
					do printoddeven with lcReport, lcChoice
					lcMessage = "Even pages printed ?"
					lnReady = messagebox( lcMessage, 3+32+0+0, lcMessageCaption, 0 )  &&  Yes = 6, No = 7
					if lnReady = 6
						lcChoice = "ODD"
					endif
				case lnAnswer = 2
			endcase
		else
			lcChoice = "ALL"

			do printoddeven with lcReport, lcChoice
		endif
Now user have the option to start with odd or even pages and finish after turning the paper around with even or odd pages

Please report back if you face any difficulties with this.

Regards,

Koen
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform