Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing odd / even
Message
 
To
22/04/2009 05:20:25
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01395867
Message ID:
01395899
Views:
144
This message has been marked as the solution to the initial question of the thread.
>Hi,
>
>I would like to print the odd / even pages and found a coding doing so however one drawback, the unwanted pages come out as a blank page.
>Is there a logic to suppress the blank page?
>
>code I have found:
>
>
>Parameters tcReport, tcOddEven
>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 (home()+"ffc\_reportlistener.vcx")
>
>  icWhatToPrint=Upper(tcOddEven)
>  
>  procedure Render
>  lparameters tnFRXRecNo,tnLeft,tnTop,tnWidth,tnHeight,;
>  tnObjectContinuationType,tcContentsToBeRendered,toGDIPlusImage
>    if this.PageNo%2=1 and this.icWhatToPrint="EVEN"
>      nodefault
>      return
>    endif
>    if this.PageNo%2=0 and this.icWhatToPrint="ODD"
>      nodefault
>      return
>    endif
>  endproc
>
>enddefine
>
>
>
>Thanks for replying,
>
>Koen

Try this:
loOddEvenListener=newobject("OddEvenListener")
loOddEvenListener.ListenerType=1  &&Preview
loOddEvenListener.WhatToPrint="EVEN"
report form ... object loOddEvenListener

*-----------------------------------
define class OddEvenListener as UpdateListener of (home()+"ffc\_reportlistener.vcx")

  WhatToPrint="ALL"

  function IncludePageInOutput
  lparameters tnPageNo
    return this.WhatToPrint="ALL" OR (tnPageNo%2=1 and this.WhatToPrint="ODD") or (tnPageNo%2=0 and this.WhatToPrint="EVEN")

enddefine
*-------------------------------------------
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform