views:

111

answers:

1

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.

+1  A: 

I think it is getting the web server's default printer. Technically a web application cannot detect client's printers, users selects it.

hallie