Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Label fonts change spontaneously at runtime

Status
Not open for further replies.

ccbryan

Programmer
Dec 31, 2013
8
US

This one is surpassingly strange...

My application has been running for years (and years) without any problems such as this one. We recently made some changes in the network environment (Citrix, print server, etc.) We had lots of problems getting our printing sorted out, especially two .lbx formats, a hang tag and a receipt. By juggling drivers and printer settings we have mostly ironed these out, but now we are in a pattern where everything pretty much goes OK except that every day around 1:45 these two labels begin printing crazy. Typically the hangtag will begin to print as a tiny version of itself in the upper left corner of the page - or it will lose track of which printer tray it is supposed to be on, and the receipt font will become enormous and the receipt 4 feet long. This happens more or less simultaneously to multiple locations runnning the application via Citrix. Restarting the application once or twice usually puts things back right. Strangely, only these labels seem to suffer from this; reports (.frx) seem immune

These changes are spontaneous; both labels are inside inside the compiled exe and all locations are running the same executable. We have checked event logs on all the servers involved (Citrix, printserver, dataserver) but see nothing amiss.

I just wonder if anyone has experienced anything like this... ???


Chandler
 
1. Try printing to a PDF (BullZip, etc) and then print to actually printer that PDF file.
2. Try different IP and Switch with one of the remote PC.

nasib
 
Here are a few things that sprang to mind as we have a similar environment for our major client.

[ol 1]
[li]When you modified the EXPR field in the lbx, did you also blank the tag and tag2 fields in the same record? There is extra stuff stored there when the report form gets upgraded from earlier versions. We resorted to putting *very* little in the EXPR field and defining multiple printer queues to the same physical printer to change the default printer setup. We still allow ORIENTATION=1 to control landscape printing and PAPERSIZE=11 for the few A5 printouts. NOTE: Once you do this, you may need to recheck it each time you modify the report form/label, regardless of your setting of saving printer environment. That's why I use a program to check all my reports.[/li]
[li]We use WMI to get the printer list as it is session specific, which is a big help on Citrix. I've included some code below.[/li]
[li]How much extra memory do the new servers have and have you limited the memory on each session to 2GB? Typically we find mid afternoon to be the busiest time of the day which pushes out memory usage.[/li]
[/ol]

Code:
* This is only a section of the routine. cNewName is a parameter containing the printer name that is trying to be selected.

* Try finding printer name in the Port string (for Citrix client printers)
local oWMIService, oPrinterColl, oPrinter, cComputername, oE, cPort
cComputername= getenv('COMPUTERNAME')

try
	* WMI only returns printers for the current session
	oWMIService= getobject("winmgmts:{impersonationLevel=impersonate}!\\" + m.cComputername + "\root\cimv2")
	oPrinterColl= oWMIService.ExecQuery('Select * from Win32_Printer')
	for each oPrinter in oPrinterColl
		cPort= getwordnum(oPrinter.portname, 1, "[")	&& Strip off any trailing printer information in []
		if alltrim(upper(m.cNewName)) == alltrim(upper(getwordnum(m.cPort, getwordcount(m.cPort, ':'), ':')))
			ok= .t.
			try
				set printer to name (oPrinter.name)
			catch
				ok= .f.
			endtry
			exit
			*VVVVV
		endif
	endfor
catch to oE
	* Do your own error handling here!
endtry

Hope that helps.

Rob Spencer
Caliptor Pty Ltd
 
While most of the things mentioned above are certainly valid issues which can definitely affect printing, the one thing that seems to not be getting enough attention is the Good Print Time Range vs the Bad Print Time Range.

I'd like to focus on your having told us: for most of the day these same labels print fine with no problem

Yes, if the Expr, Tag and/or Tag2 field contents of the Label had the wrong contents it would affect printing. But it would affect printing at ALL times of the day, not only for a repeatedly fixed period of time during the day.

And, Yes, if the Print Driver itself was acting problematically, it too would affect printing. But it too would be affecting printing at ALL times of the day, not only for a repeatedly fixed period of time during the day.

Apparently something is causing a Temporary change in the printing (resulting in bad print outs) and, somehow, reverting to its former state (resulting in good print outs).

And, if this problem is appearing in multiple remote locations at basically the same time range, then the cause is most likely to be occurring centrally.

Also, since the program code itself is not changing, the most likely source of the problem seems to be either program environmental changes or data transmission (Citrix) issues.

Other questions worth considering:
1. Is the Server Print Driver that is used for your Label printing also supporting some in-house printer during the day?
* If so, could someone in-house be using that in-house printer in some way during that time frame that would affect its default Font or other Print Driver properties?
* Suggestion - You might want to consider setting up a new, unique server Print Driver to support ONLY the remote printing.
2. You said before that you did not know the answer, but try to find out if this problem is occurring at ALL of the remote sites during the time frame - even if they have to print out Dummy/Test labels to support the investigation.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top