简体   繁体   中英

Crystal Report With Out Open To Print From Clint Machine Printer in ASP.NET C#

I have a web Application and website of same Project. The problem i am faced was whenever i want print a record from my web page that display me a dialog box and goes to server printer. because of this my server is going down . i just want to when user submit a record then print should be come from his local computer or any other network other not server computer and without any dialog box. reply will be appreciate. Thanks

By using this line of code the report should get printed to the default printer installed on the client PC:

ReportDocument.PrintToPrinter(1,true,0,0); 

If you want to hardcode the printer name, you can use an approach more like this:

//Report directly printing by Printer
string strSystemName = "\\\\SYSTEM\\";
string strPrinterName = "PrinterName";
rptPrint.PrintOptions.PrinterName = strSystemName + strPrinterName;
rptPrint.PrintToPrinter(1, false, 0, 0);
rptPrint.Close();
rptPrint.Dispose();

I don't think hardcoding the printer would be useful unless there is only one printer available.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM