For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Crystal Reports > May 2005 > Double side printing









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Double side printing
Ken

2005-05-20, 4:04 am

Hi all,

Can anyone tell me how to control crystal report to print even number of
pages for each group as I am creating a report to generate multiple clients
information and want it to print out double side on each paper.


Charles A. Lackman

2005-05-25, 8:58 pm

Hello,

First you need to get the number of pages you are printing:

The Following Imports may be necessary:

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared

Dim NumberOfCopies as Integer = 1
Dim AnInteger as Integer

AnInteger = Report.formatengine.getlastpagenumber(New
ReportPageRequestContext)

Then you can test to see if the value is even or odd, once the value has
been determined even or odd then send only the even to the printer

For X = 1 to AnInteger
If AnInteger = Even then (Add your code to test if odd or even)
MyCrystalReport.printtoprinter(NumberOfCopies, True, AnInteger, AnInteger)
End If
Next

After the even pages are printed create a MessageBox to have the user turn
the pages over and print only the odd pages

For X = 1 to AnInteger
if AnInteger = Odd then (Add your code to test if odd or even)
MyCrystalReport.printtoprinter(NumberOfCopies, True, AnInteger, AnInteger)
End If
Next

You might have to reverse the print order for the other side:

For X = AnInteger to 1 Step -1
Next

OR using STEP might simplify this process. IE.

FOR ODD
For X = 1 to AnInteger STEP 2
MyCrystalReport.printtoprinter(NumberOfCopies, True, AnInteger, AnInteger)
Next

FOR EVEN
For X = 2 to AnInteger STEP 2
MyCrystalReport.printtoprinter(NumberOfCopies, True, AnInteger, AnInteger)
Next

You will have to Experiment. Hope this helps,

Chuck

"Ken" <ken1239@hotmail.com> wrote in message
news:uxYc3XOXFHA.2124@TK2MSFTNGP14.phx.gbl...
Hi all,

Can anyone tell me how to control crystal report to print even number of
pages for each group as I am creating a report to generate multiple clients
information and want it to print out double side on each paper.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com