Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Capture a Signature
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01149063
Message ID:
01149265
Views:
23
i capture the signature as a variable and then save it as a jpg file in a subfolder called signatures. you can also save it in bmp format. I also show the signature on the screen after it has been saved and print it out on despatch notes.
just so you know how we use it, we have a customer who make plastic components. when drivers come into the factory to collect goods they typically sign for them. the poblem was that te delivery guy has to sign for each order and there could be >20 so it was a pain for him and the paperwork then had to be kept. what happens now is that he comes in and the office guy ticks off the orders that are being collected, all orders for collection are shown in a grid, and the delivery guys just signs once. this signature is saved in a subfolder and then printed out on the delivery notes that are sent out later. i save the signature image with a file name of the order number, so it would look something like 5001234.jpg. this makes it easier to find later on the forms and reports. i have put in the code below that i use, it may not be the nicest code but it does work and has not crashed out yet:) This code in in the click event of a button. if you have any Q's let me know.
~M
DODEFAULT()

* select out the orders that have been ticked to be signed for
SELECT tempdespatch

SELECT * ;
	FROM tempdespatch ;
	WHERE destrue = .T. ;
	INTO CURSOR selectedorders NOFILTER

SELECT selectedorders
IF NOT EOF()
	LOCAL epad1, result6, morderref, mitrlink, filename7, iferror, ifok
	iferror = 0
	ifok = 0
	
	TRY
			* this initialises the epad signing object
			epad1 = NEWOBJECT("esW25COM.escapture")
			
			* calling the epad signature screen
			result6 = epad1.StartSign
			
			IF result6 = 1
				* the OK button was pressed
				
				IF epad1.issigned = 0
					* there is no signature, epad software should take care of this itself
					* this will never happen, but just in case
					MESSAGEBOX("No signature recorded, please try again",48,"Warning")
				ELSE
					* there is a signature entered, confirm the saving of the signature
					IF MESSAGEBOX("Save all the details now?",36,"Save") = 6
						* loop through all of the selected orders and save the signature for each one
						SELECT selectedorders
						GO TOP
						DO WHILE NOT EOF()
							morderref = ALLTRIM(ordref)
							mitrlink = ALLTRIM(STR(itrlink))
							
							IF morderref <> " "
								ifok = ifok + 1
								filename7 = SYS(5) + SYS(2003) + "\signatures\" + STRTRAN(morderref,'/','-') + ".jpg"
								* parameters (filename,width,height,filetype(1=jpg:0=bmp),% quality of image: 80 is default)
								epad1.SaveToFile(filename7,300,200,1,80)
							ELSE
								* this should never happen as all order have to have an order number
								iferror = iferror + 1
								MESSAGEBOX("Problem with this line = " + mitrlink + " , contact Kernel",16,"Warning")
							ENDIF
							
							SELECT selectedorders
							SKIP
							LOOP
						ENDDO
						
						IF iferror = 0
							MESSAGEBOX("Signature saved for " + ALLTRIM(STR(ifok)) + " Lines",64,"Saved")
						ELSE
							* should never really end up in here as only blank order number causes this
							MESSAGEBOX("There was a problem with " + ALLTRIM(STR(iferror)) + " lines, " + ;
								+ ALLTRIM(STR(ifok)) + " lines saved ok",64,"Problem")
						ENDIF
						
						* we are finished close the signature object
						epad1 = .NULL.
					ELSE
						epad1 = .NULL.
						MESSAGEBOX("No signature saved",64,"Information")
					ENDIF
				ENDIF
			ELSE
				* the cancel button was pressed
				epad1 = .NULL.
				MESSAGEBOX("No signature saved, please try again",48,"Warning")
			ENDIF
		CATCH
			MESSAGEBOX("problem with signing",16,"Warning")
		FINALLY
			* no code to go in here
	ENDTRY
	
ELSE
	* no transactions were selected
	MESSAGEBOX("No despatches selected to sign for",64,"Warning")
ENDIF
>Mark
>
>How do you capture it (as a variable?) and then store it?
>
>Thanks
>
>Kirk
Go raibh maith agat

~M
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform