Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Image in Label Form
Message
De
29/07/2013 21:03:54
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Image in Label Form
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01579390
Message ID:
01579390
Vues:
112
We need to print a 2D Barcode in a label. We are using a 3rd party package (foxbarcodeqr) which takes the string you pass it and creates a JPG (PNG/BMP also available) file. This part is working properly.

The code in my "Print" button is.....
SET STEP ON 
loFbc = NEWOBJECT("FoxBarcodeQR","progs\foxbarcodeqr.prg")
SCAN
**** Set the data for the bar-code field
	lcBarCodeString = TRANSFORM(recv_lbl.recv_qty )
	lcBarCodeString = lcBarCodeString + ";Record "+TRANSFORM(RECNO())
	lcBarCodeString = lcBarCodeString + ";"+TRIM(crsselection.supname)
	lcBarCodeString = lcBarCodeString + ";"+TRIM(recv_lbl.rev)
	lcBarCodeString = lcBarCodeString + ";"+TRIM(recv_lbl.desc1+desc2)
	lcBarCodeString = lcBarCodeString + ";"+TRIM(recv_lbl.date_code)
	lcBarCodeString = lcBarCodeString + ";"+dtoc(date())
	lcBarCodeString = lcBarCodeString + ";"+TRIM(crsselection.uniq_key)
	lcBarCodeString = lcBarCodeString + ";"+TRIM(recv_lbl.pno)

**** Create the bar_code image
	lcQRImage = loFbc.QRBarcodeImage(lcbarcodestring,,2,1)

**** Copy to the "Picture" file
	COPY FILE (lcQRImage) TO ("c:\tempdl\2d_bar_code.jpg")

	DELETE FILE (lcQRImage)

	Label Form [Reports\2d_POQUERY] NEXT 1 To PRINTER NOCONSOLE
			
	DELETE FILE ("c:\tempdl\2d_bar_code.jpg")
ENDSCAN
The Label Form has a Picture/Active X Bound Control which is set to Print Picture From a file. The filename property is set to "c:\tempdl\2d_bar_code.jpg"

The problem is that the same bar code is printing on all the labels. I've stepped through the code and verified that this file gets deleted and re-created as expected. I've manually changed the "bar-code picture" to a real picture image before issuing the next LABEL FORM command, but I still get the original image.

I've tried SYS(1104) in the hope that would clear wherever the picture is being cached, but without success.

All suggestions welcome.

........Rich
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform