• How to print direct report (.rdlc) using Web Client Print in ASP.NET MVC?

    by  • November 5, 2015 • Microsoft .NET Framework, Microsoft ASP.NET, Microsoft ASP.NET MVC • 0 Comments

    WebClientPrint for ASP.NET is a solution for Client-side printing scenarios for Windows, Linux and MAC OS X clients, designed for ASP.NET Web Forms and MVC website projects.

    We can directly print any file without showing or displaying any print dialog box with WebClientPrint. With the WebClientPrint , you can easily send any data to printers.

    WebClientPrint is a client-server solution:

    The Server-side component:
    It is a .NET managed-code assembly (Neodynamic.SDK.WebClientPrint.dll) which is used in your ASP.NET website to generate “Client Print Jobs”. A Client Print Job allows you to specify what client printer to use and the commands you want to print or send to the client printer.

    Use “the Default printer” of the client machine. Printing will be performed without displaying any dialog!

    Use “a specific installed printer’s name” on the client machine. Printing will be performed without displaying any dialog! This also applies for Shared Printers on the client machine network with a UNC name/path!

    Display a “printer dialog” to let the user to select the printer

    Explicitly specify the client printer settings for parallel (LPT) Centronics or serial RS-232 ports or IP/Ethernet Network printers.

    The Client-side component:

    It is the WebClientPrint Processor (WCPP) utility that needs to be installed at the client machine just once. WCPP is a lightweight native app (without any dependencies) that processes all the “Client Print Jobs” generated by the server-side component.

    Follow up these steps:

    • Download & install WebClientPrint for ASP.NET
    • Open Visual Studioand create a new NET MVC Website naming it PrintPdfSample
    • Add a reference to SDK.WebClientPrint.dllto your project
    • Open your configfile and add the following entries:

    Controller.cs:

    Since there is no server-side processing, the controller class is also fairly simple and it practically does nothing. It is only receiving parameter of printer name and then print report directly go to printer without show dialog. The controller class used in the example is shown below:

    View.cshtml:

    The View used in the example is shown below:

     

     

    But WebClientPrint occurs problem when you are enable authentication. In next article I will explain how to print directly report while window and form authentication has enabled.

     




    Namecheap.com
    Avatar of Abdul Rehman

    About

    Abdul Rehman writes on .NET technologies at GetCodeSnippet.com. GetCodeSnippet.com provides you high quality Microsoft .NET development related articles, tutorials and sample code for ASP.NET, C#, VB.NET, AJAX, WCF, WPF, Web Services, Windows Services, SQL Server and other technologies.

    http://getcodesnippet.com

    Leave a Reply