I want the "default printer name" on the client's computer to print the Crystal ReportViewer Content

Posted by indira prasad on Stack Overflow See other posts from Stack Overflow or by indira prasad
Published on 2010-03-30T06:10:55Z Indexed on 2010/03/30 6:13 UTC
Read the original article Hit count: 382

Filed under:

I want the "default printer name" on the client's computer to print the Crystal ReportViewer Content

My Code :

            printDocument = new System.Drawing.Printing.PrintDocument();
            int nCopy = printDocument.PrinterSettings.Copies;                
            int sPage = printDocument.PrinterSettings.FromPage;
            int ePage = printDocument.PrinterSettings.ToPage;
            string PrinterName = printDocument.PrinterSettings.PrinterName;
            rpt = (ReportDocument)Session["Report"];
            rpt.PrintOptions.PrinterName = PrinterName;
            rpt.PrintToPrinter(nCopy, false, sPage, ePage);

It is working fine locally but when I host the Application in IIS, that printer name it is taking default 'Microsoft XPS Document Writer' .

thanks in advance.

© Stack Overflow or respective owner

Related posts about crystal-reports