简体   繁体   中英

Crystal Report Printing Stops

My problem is, from time to time my receipt printer stops printing. Like after 60+ prints, it stops then it doesn't print anymore unless I do a fresh restart of the printer and the program.

I'm not quite sure where the problem of this situation lies, could be the printer itself or the Crystal Report from loading data.

What we did so far, was adding lines of codes which enables to refresh the data thats being loaded into Crystal Report. This however didn't solve the problem.

The receipt-printer I'm using is EPSON TM-T81

Anyone who has experienced such problem before?

Your kind reply would be greatly appreciated.

Jim

Sorry this is so late, but it's by design. There is a maximum number of prints allowed by the crystal runtime used in the .net runtime. Your question doesn't say...

The solution is to properly clean up all crystal resources after each print. That is, dispose of the report, and then set it to null before even loading the next report. Don't bother with the registry modifications as these will always get broken.

I had to write a print Manager class that effectively single threaded print operations as well as handle the cleanup of report resources. The result is that I am able print/export unlimited numbers of reports.

Something along the lines of:

CrystalReportViewer1.Dispose(); // if using the viewer
CrystalReportViewer1 = null;
report.Close(); // I can't remember if this is part of the reportDocument class
report.Dispose();
report = null;
GC.Collect(); // crazy but true. Monitor the temp folder to see the effect

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