0
votes

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

1
McJim, have you checked your print spooler in the OS? And when you say 60+, ist that 60 pages or 60 times printing the report. Does it happen with just one report or any report?campagnolo_1
Hello again campagnolo_1. I wasn't familiar with print spooler until i searched for it. But not sure if I'm getting it right. If not mistaken, this is in "C:\Windows\System32\spool\PRINTERS" is that it? What am I looking for in this case? Sorry, I meant 60 times printing the report. It happens with other reports as well.McJim
So if it happens with other reports, I'm pretty sure it's the printer or print spooler. One thing you can do is to check your Event Viewer. Click the start button and type Event Viewer in the Search Box (or go to Control Panel and Administrative Tools and Event Viewer). See if you get any events for the printer. Also make sure you have the most up to date driver for your printer. Report back. ;)campagnolo_1

1 Answers

0
votes

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