none
Printing more than one copy of a report (without PrintViewer) RRS feed

Answers

  • I figured it out.  I added a parameter to the Print function to specify the number of copies to print and then added one line of code (see line 17):

    1     Private Sub Print(ByVal copies As Integer
    2         Const printerName As String = _ 
    3           "Microsoft Office Document Image Writer" 
    4  
    5         If m_streams Is Nothing Or m_streams.Count = 0 Then 
    6             Return 
    7         End If 
    8  
    9         Dim printDoc As New PrintDocument() 
    10         printDoc.PrinterSettings.PrinterName = printerName 
    11         If Not printDoc.PrinterSettings.IsValid Then 
    12             Dim msg As String = String.Format( _ 
    13                 "Can't find printer ""{0}"".", printerName) 
    14             Console.WriteLine(msg) 
    15             Return 
    16         End If 
    17         printDoc.PrinterSettings.Copies = copies 
    18         AddHandler printDoc.PrintPage, AddressOf PrintPage 
    19         printDoc.Print() 
    20     End Sub 
    21  
     
    • Marked as answer by Hutch619 Thursday, September 4, 2008 5:31 PM
    • Edited by Hutch619 Thursday, September 4, 2008 5:34 PM higlighting modification (couldn't do originally because I was in Firefox)
    Thursday, September 4, 2008 5:31 PM