Printing to Defined Printer

2 posts, 0 answers
  1. Chris
    Chris avatar
    15 posts
    Member since:
    Aug 2012

    Posted 15 Feb Link to this post

    I have a program that gets some data from a database and prints a report to a printer on schedule. It runs unattended so there can never be user input. I have it printing to the default printer, but I'd like to print to a defined network printer (\\servername\printername). 

     

    How can I code that?

  2. Stef
    Admin
    Stef avatar
    3047 posts

    Posted 17 Feb Link to this post

    Hello Chris,

    You can print a report programmatically by using a ReportProcessor. The ReportProcessor.PrintReport method expects PrinterSettings which has to be valid to avoid popping a modal dialog, if the operation is executed by a service. The PrinterSettings properties allow you to specify any connected to the machine printer (PrinterSettings.PrinterName)..

    More settings required for using a network printer are discussed in forums like stackoverflow e.g. PrintDocument.PrinterSettings.PrinterName \\servername\printername Not Available.


    I hope this information helps.

    Regards,
    Stef
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top