The application my team is working on is developed using WPF & ,NET 4.0. The application also communicates with thermal printer connected to PC (like the ones used in malls, but its not a POS system). We only have 1 printer connected to the PC.
The application connect to printer and the output is often successful without any issues and parallel we save the data into the DB (SQL Server 2008 and going to SQL Server 2012).
On a very rare occasions the printout is not available but the data is saved to DB.
Is there any way to check or capture the printer related issue when we face this type of problem?
Thanks in advance.
Please Check whether your drivers are up to date.
And use debugging to check whether an error occurs when executing the code.
for this you can use try catch blocks which throws exceptions.
Related
I am develop a ASP.NET (SOAP) web service for print KOT/BOT print outs . I am using "PrintDocument" class for handle print jobs and the printer is Epson TM U220 network printer. The problem is when calling the print web method sometimes its generate DUPLICATE print outs. But according to my system logs, from the web method call print function only onetime, but from the Printer (Epson TM U220) generate same print out twice. Also this not happening every time. We are also unable figure out in which point this issue is occur.
Also this problem not occurring in our office testing environment. This happening our one client site only. Customer complain time to time, system generate DUPLICATE KOT/BOT printouts. And also their not using dedicated server PC for the IIS server and SQL server database. Their using standard shared PC for system. So is this a problem of the web service, IIS server or the Hardware (System PC or LAN Network communication between PC and the Printer)?
By the way is this AutoCutter or not? Epson has a "Serial emulation driver" that makes a USB printer act like it's on a real serial port. Then you can use direct-to-port in Campground Master, set up as a serial printer and test it whether its keep hapenning duplicate printing. but you might need to use service to talk to port in the destination computer (local port printing) we did sometime when we had simillar issue.May be this help to you
I have a web forms application that creates a PDF and sends it to the client. It was all well and dandy until I uploaded the aplication to Windows Server 2012 R2. The problem might be some printer settings on the server (this is my first time working with a server).
The problem is Server 2012 doesn't support Windows Print to PDF, which I used on local machine and it worked great.
I gave a shot to CutePDF Writer: installed it and set it to default printer in Printers and devices. When I run the application, I get the following error:
System.Drawing.Printing.InvalidPrinterException: No printers are installed
I tried this and it generates the PDF but fails and I get an error when I try to open the PDF:
PrintDocument.PrinterSettings.PrinterName = "CutePDF Writer";
This line returns "true":
PrintDocument.PrinterSettings.IsDefaultPrinter
while this line returns "Default printer is not set.":
PrintDocument.PrinterSettings.PrinterName
I gave a shot with this, but returns "false":
Setting the default Printer for windows using c#
Please help!
The answer is trying a different approach. I shouldn't have tried working with the virtual printer (i haven't found a way to make it work).
To create a PDF from code, the best way is using iTextSharp.dll. With that you need a handful of code. Yes, I had to implement the report-creating and printing logic all over again, but it was actually easyer than the previous approach. iText is pretty straightforward and easy to use!
I'm developing on a Windows CE 5 device that has a printer. I've got a running VB.Net (compact) program on it and no problems interacting with the device's Printer library there. But with a program written in C#, I got PInvoke errors after the device had been in standby mode for a while. I managed to fix that problem by copying the .dll file from the device's Windows folder and pasting it in the C# program's directory.
Now, I'm getting problems with the SQL Server CE DLL! Same thing -- it's happening on the C#, but not the VB.Net program, and it happens after the device had been in standby mode for a long while. It doesn't happen with all components of SQL Server CE either - just when I'm doing a merge replication. To get it to work again I close and re-run the program. And that's fine for me but not acceptable for users.
What could be causing this? Is it just a difference with C#? I don't want to have to paste all SQL Server CE libraries in my program directory.
(Both programs have the SQL Server CE library added to References, both have using/Imports System.Data.SqlServerCe in the code)
You should make your device Suspend/Resume aware. Note that the suspend notification is delivered AFTER the next resume.
Most programmers forget that a Mobile device is not in an always connected and powered state. If the device suspends, for example, and the app has opened a file on external storage. the storage might be powered down/up during a suspend/resume cycle. The app then needs to close the file and re-open it. Same with network and other wireless or wired connections. These may go down during suspend and need to be re-initialized on resume.
I get the error mentioned when printing to a network printer.
The error does not occur when run under XP/Win2003, in a WinForm app or when a local printer is used.
The error does only occur when run as a Windows Service under Vista/Win7/Win2008 and printing to a network printer.
The Windows service runs under a network user that has access to the network printer. Before I print I check if the printername (including network path) is ok by looping through the available printers.
How can this be solved?
Solved by adding the printer to the SYSTEM user via a registry hack as described in the Microsoft doc: http://support.microsoft.com/kb/184291/en-us.
For anyone that stumbles across this issue in the future.
Double check that your Printer Name is correct as it could also be the reason you might be getting this error.
In my case we got same error for windows 10 os client computers.
I think the error is related users and their permissions.
After making the client computers to our company's domain the error was fixed.
I have a fairly simple CRUD web application (C#/ASP.NET) that runs fine in Firefox, IE7, and Chrome. (I'm accessing and testing the application on our development server.)
When I connect to the dev site via a Pocket PC device and go through the exact same steps, I get an ODBC error. Unfortunately, when I step through the code (once again, on my desktop) I can't duplicate the error. Same environment, different browser. All the code is server side, so I can't figure out why I'm getting different results.
I've run through the code with the Pocket PC emulator and it works fine. It only happens when I access the site via the actual device. I have similar pages, accessing the same ODBC database that don't have this problem on the Pocket PC device.
Anyone ever seen something like this? I'm stumped.
Edit: Here's the text of the ODBC error. The error code '38121' refers to an invalid order number, even though I know for sure that the order number is not invalid. (I'm using the same order number on my desktop as I am on the handheld.) If needed, I can post the stack track too.
****ERROR [HY000] [CA][IDMS ODBC Driver][IDMS]DB001075 C-4M321: Procedure LOEPU041 exception 38121 ?**
Double edit: Chalk it up to user error. The database requires all parameters to be entered in uppercase. On my machine I was used to entering the order number in all uppercase. Since the Pocket PC has a crappy keyboard, I would always just enter it in lowercase. A simple ToUpper() fixed it. Holy crap, I feel dumb.
Check the values are submitted as you
expect them in the request handler
Check the values are passed to the
database statements correctly
Implement server-side error logging /
tracing
Memorize the text of the error
message(s)