A problem with printing in asp.net

Source: Internet
Author: User
Tags execution stack trace
Asp.net| Printing | questions
In ASP.net, you define the
Reportdocument rep = new CrystalReport2 ();
Rep. Setdatasource (This.datasetuser1);

This. Crystalreportviewer1.reportsource = rep;
Rep. Printtoprinter (1,false,1,1);
The result appears as follows:
A server error in the "/myweb/webapplication" application.


Error in file C:\docume~1\llm\aspnet\locals~1\temp\temp_15e5dcd2-3cbd-40fb-85be-b1251f6339ac.rpt: no default printer.
Note: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace for more information about the error and where the error occurred in the code.

Exception Details: CrystalDecisions.CrystalReports.Engine.PrintException: File C:\docume~1\llm\aspnet\locals~1\temp\temp_ Error in 15E5DCD2-3CBD-40FB-85BE-B1251F6339AC.RPT: no default printer.

SOURCE Error:

Row 78:private void button2_click (object sender, System.EventArgs e)
Line 79: {
Line 80:rep. Printtoprinter (1,false,1,1);
Line 81:}
Line 82:}


A server error in the "/myweb/webapplication" application.


Error in file C:\docume~1\llm\aspnet\locals~1\temp\temp_15e5dcd2-3cbd-40fb-85be-b1251f6339ac.rpt: no default printer.
Note: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace for more information about the error and where the error occurred in the code.

Exception Details: CrystalDecisions.CrystalReports.Engine.PrintException: File C:\docume~1\llm\aspnet\locals~1\temp\temp_ Error in 15E5DCD2-3CBD-40FB-85BE-B1251F6339AC.RPT: no default printer.

SOURCE Error:

Row 78:private void button2_click (object sender, System.EventArgs e)
Line 79: {
Line 80:rep. Printtoprinter (1,false,1,1);
Line 81:}
Line 82:}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.