CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2003
    Location
    Mexico
    Posts
    12

    How to avoid Printig Dialog Window, and Printing Records window

    Hi to everyone.

    I'm using VB6 and Crystal Reports XI.

    Does anybody known how to...

    1) Avoid the Printing Dialog Window that pops after the .PrintReport command.

    2) Avoid the Printing Records window that appears after the Printing Dialog Window.

    The app requires that the user don’t be able to choose any printer, and don’t be able to stop the printing process when it started.


    Thanks in advance.

  2. #2
    Join Date
    Jul 2005
    Posts
    1,083

    Re: How to avoid Printig Dialog Window, and Printing Records window

    Check if PrintReport has a parameter like .PrintReport False
    or
    You can send directly to the printer setting .Destination property

  3. #3
    Join Date
    Jul 2003
    Location
    Mexico
    Posts
    12

    Re: How to avoid Printig Dialog Window, and Printing Records window

    Quote Originally Posted by jggtz
    Check if PrintReport has a parameter like .PrintReport False
    or
    You can send directly to the printer setting .Destination property
    Hi...

    .PrintReport have no parameters available, (at least not with CR XI), and .Destination causes that the destination selected, in this case a printer, be the default printer in the Printers Dialog window.

    Anyway I keep trying.

    Thks for your answer.

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: How to avoid Printig Dialog Window, and Printing Records window

    How about this?
    [QUOTE]
    PrintOut Method (Report Object)
    Use the PrintOut method to print out the specified pages of the report to the
    printer selected using the “SelectPrinter Method (Report Object)” on
    page 154. If no printer is selected, the default printer specified in the report
    will be used. This method can be invoked only when in formatting idle mode.
    Syntax
    Code:
    Sub PrintOut ([promptUser], [numberOfCopy], [collated], _
    [startPageN], [stopPageN])[
    /QUOTE]

    http://technicalsupport.businessobje...%200%209308036
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Jul 2003
    Location
    Mexico
    Posts
    12

    Re: How to avoid Printig Dialog Window, and Printing Records window

    Quote Originally Posted by dglienna
    How about this?
    PrintOut Method (Report Object)
    Use the PrintOut method to print out the specified pages of the report to the
    printer selected using the “SelectPrinter Method (Report Object)” on
    page 154. If no printer is selected, the default printer specified in the report
    will be used. This method can be invoked only when in formatting idle mode.
    Syntax
    Code:
    Sub PrintOut ([promptUser], [numberOfCopy], [collated], _
    [startPageN], [stopPageN])[
    /QUOTE]

    http://technicalsupport.businessobje...%200%209308036
    Hi dglienna...

    That method have the same effect as .Destination method, which causes that the destination selected, be the default printer in the Printers Dialog window.

    I´m still trying

    Thanks for your answer

  6. #6
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: How to avoid Printig Dialog Window, and Printing Records window

    Print to a file, and then copy it to a printer
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  7. #7
    Join Date
    Dec 2006
    Location
    Pune, India.
    Posts
    579

    Re: How to avoid Printig Dialog Window, and Printing Records window

    Hi

    Try this :
    Code:
                'crReport is CRADRT.Report object
    
                'Get the printer object of selected printer
                For Each prn In Printers
                    If prn.DeviceName = PrinterName Then Exit For
                Next
    
                
                'Set the printer to the report.
                crReport.SelectPrinter prn.DriverName, prn.DeviceName, prn.Port
    
                
                'Print the report
                If Pages = "ALL" Then
                    crReport.PrintOut False, NoOfCopies, False
                Else
                    'Print range of pages
                    crReport.PrintOut False, NoOfCopies, False, FromPages, ToPages
                End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured