Because I like it when others post their solutions, here's the
solution for calling my vb.net label printing program from a custom
button on the Serial Number Assignment Form.
First I added a button called btnPrintLabels to the form then ran the
Event Wizard and added the Click event.
Private Sub btnPrintLabels_Click(ByVal Sender As Object, ByVal Args As
System.EventArgs) Handles btnPrintLabels.Click
Dim edvJobSerialView as EpiDataView =
CType(oTrans.EpiDataViews("jobSerialView"), EpiDataView)
Dim edvSSNView as EpiDataView =
CType(oTrans.EpiDataViews("ssnView"), EpiDataView)
Dim strJob as String
Dim strSer as String
Dim blnVoided as Boolean
Dim ret as Integer
' Grab the JobNumber from the JobSerialView
strJob =
edvJobSerialView.dataView(edvJobSerialView.row)("JobNumber").ToString()
' Read each row in the ssnView and eliminate voided numbers
for each dr as DataRowView in edvSSNView.dataView
strSer = dr.Row("SerialNumber").ToString()
blnVoided = dr.Row("Voided")
if not blnVoided then
' Since the Shell commmand is hiding the program, indicate
which serial number is printing
oTrans.PushStatusText("Printing " & strSer, True)
ret = Shell("C:\Program Files\UFM\PrintLabels.exe " & strJob &
" " & strSer, 0, True, 5000)
oTrans.PopStatus()
end if
next
End Sub
Thanks for your help Bernie. Armed with this, I think I'll add a tab
to the Job Entry Form to display the currently assigned serial numbers.
Mark W.
solution for calling my vb.net label printing program from a custom
button on the Serial Number Assignment Form.
First I added a button called btnPrintLabels to the form then ran the
Event Wizard and added the Click event.
Private Sub btnPrintLabels_Click(ByVal Sender As Object, ByVal Args As
System.EventArgs) Handles btnPrintLabels.Click
Dim edvJobSerialView as EpiDataView =
CType(oTrans.EpiDataViews("jobSerialView"), EpiDataView)
Dim edvSSNView as EpiDataView =
CType(oTrans.EpiDataViews("ssnView"), EpiDataView)
Dim strJob as String
Dim strSer as String
Dim blnVoided as Boolean
Dim ret as Integer
' Grab the JobNumber from the JobSerialView
strJob =
edvJobSerialView.dataView(edvJobSerialView.row)("JobNumber").ToString()
' Read each row in the ssnView and eliminate voided numbers
for each dr as DataRowView in edvSSNView.dataView
strSer = dr.Row("SerialNumber").ToString()
blnVoided = dr.Row("Voided")
if not blnVoided then
' Since the Shell commmand is hiding the program, indicate
which serial number is printing
oTrans.PushStatusText("Printing " & strSer, True)
ret = Shell("C:\Program Files\UFM\PrintLabels.exe " & strJob &
" " & strSer, 0, True, 5000)
oTrans.PopStatus()
end if
next
End Sub
Thanks for your help Bernie. Armed with this, I think I'll add a tab
to the Job Entry Form to display the currently assigned serial numbers.
Mark W.