>* 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 >>
>** 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 >>