Link to home
Start Free TrialLog in
Avatar of btrieve
btrieve

asked on

Duplex printing and Tray selection from vb.net to Canon copier model IR-3570

Greetings,

We need to be able to send a report to print in duplex mode as well as to control the printer's source tray. We are using the code below to no effect. We are not quite sure if the problem is with the code (are we missing a setting?) or if the generic .net class is not capable to control settings to the Canon copier. Could you please help?

    Public Sub PrintReport()
        Dim pd As New PrintDocument
        AddHandler pd.PrintPage, AddressOf Me.pd_PrintPage
        pd.PrinterSettings.Duplex = Duplex.Horizontal
        pd.Print()
    End Sub

    Private Sub pd_PrintPage(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
        Dim Report As New xrptBOLSup
        Dim ps As New PageSettings
        Dim pr As New PrinterSettings
        ps.PaperSource = pr.PaperSources.Item(1)    !Tray Selection
        Report.PrintingSystem.PageSettings.Assign(ps)
        Report.ShowPreview()
    End Sub
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

Just out of curiosity what are you trying to print? a crystal report?
Avatar of btrieve
btrieve

ASKER

Actually we are using Developer Express's report control. I don't believe it makes a difference tho.



ASKER CERTIFIED SOLUTION
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
FYI...the printer this was originally written for was a Canon 6000
Avatar of btrieve

ASKER

Hi BriCrowe,

Thank you very much for your suggestion. I created a test project to test your solution with a Crystal Report but it sill would not do the tray selection correctly or the duplexing. I am starting to think that this specific model does not interface well with the generic classes.  We have contacted Canon for a copy of their SDK which we hope will take care of this problem.

Ingrid
It might help if you stepped through your code after selecting the correct papersource/duplex setting via the printdialog to see what it's looking for.  That's what I had to do to determine the "upper" and "auto" settings.
Avatar of btrieve

ASKER

Yes, I did step thru the available selection before choosing the tray that I wanted to print to. When that did not work I printed to each tray in turn. I always printed to the default tray. I know it does not make sense. BTW: are you familiar with Canon’s SDK?
Unfortunately no...I never had to go that far.  There is one other possibility that I can think of though.  I ran into this with a Dell printer.  Some printers especially HP's (I ended up installing an HP driver on our Dell printer because the Dell/Lexmark driver would blow up if I sent too many consecutive printtoprinter calls to it) use a "custompapersource".  When I sent over the "upper", "lower" etc to that printer it didn't know what to do with it and went to its default paper source.  If your defaultpagesettings.papersource is coming over as custome you will need to look into a hotfix that businessobjects put out recently to handle it.  I will be happy to look up the links they sent me when I contacted them about it if you think this might be your issue.
Avatar of btrieve

ASKER

It sounds like it is worth a try. Thanks for being so helpful!