Automating addition of user signature in FormDocs
From Support
The following code may be added to your current form in order to add a variable signature image which is changed based on the user ID sent.
Please note that it assumes the existence of .bmp files for each user by System i username in C:\signatures. Therefore, where the user is JOE, the image is JOE.bmp.
' *** Select signature for user ***
' Use file name C:\SIGNATURES\"USERID".BMP, turn off signature if it doesn't exist.
'If trim(Thisform.fields("userid").value) > " " Then
If FileExists ("C:\signatures\" + trim(ThisForm.Fields("userid").value) + ".bmp") Then
' Sets the visiblity of the userid fill field to false
ThisForm.Fields("userid").visible = false
' Activate the Image Fill Field
ThisForm.Fields("signature").activate
ThisForm.Fields("signature").printable = true
' Set the path to the image file
ThisForm.Fields("signature").value = "C:\signatures\" + trim(ThisForm.Fields("userid").value) + ".bmp"
Else
' Sets the visiblity of the userid field to false
ThisForm.Fields("userid").visible = false
' If the userid fill field doens't meet the criterea, then don't print the image on the form
ThisForm.Fields("signature").Printable = false
End If
