Looking for a reference

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.
...in V8 customization code.

I have a standalone program that prints serial number labels. I pass it the
job number. I thought, "Hey, wouldn't it be cool to call this program within
Vantage?" So I created a button on the Assign Serial Number form but I don't
know how to reference the Job Number (txtKeyField) on the form so I can pass
it to the program. Any thoughts?

Bonus question:
I'm currently opening up an ODBC connection, searching for the serial numbers
by job but if I knew how to reference the serial numbers on the same form, I
can do away with ODBC.

Thanks for any input.

Mark W.
Define a text box that will 'mirror' the form text box:

Private WithEvents txtJobNumber

In the form load event set your text box to 'mirror' the forms text
box:

txtJobNumber = CType(csm.GetNativeControlReference("46567b2e-6bc0-
4967-be35-a0ec6843838f"), EpiTextBox)

(you find the 46567b2e-6bc0-4967-be35-a0ec6843838f from the EpiGuiId
of the control you want to 'mirror')

Now you use txtJobNumber.Text property

HTH
Bernie.


--- In vantage@yahoogroups.com, "Mark Wonsil" <mark_wonsil@...> wrote:
>
> ...in V8 customization code.
>
> I have a standalone program that prints serial number labels. I
pass it the
> job number. I thought, "Hey, wouldn't it be cool to call this
program within
> Vantage?" So I created a button on the Assign Serial Number form
but I don't
> know how to reference the Job Number (txtKeyField) on the form so I
can pass
> it to the program. Any thoughts?
>
> Bonus question:
> I'm currently opening up an ODBC connection, searching for the
serial numbers
> by job but if I knew how to reference the serial numbers on the
same form, I
> can do away with ODBC.
>
> Thanks for any input.
>
> Mark W.
>
Bernie wrote:
> Define a text box that will 'mirror' the form text box:
>
> Private WithEvents txtJobNumber
>
> In the form load event set your text box to 'mirror' the forms text
> box:
>
> txtJobNumber = CType(csm.GetNativeControlReference("46567b2e-6bc0-
> 4967-be35-a0ec6843838f"), EpiTextBox)
>
> (you find the 46567b2e-6bc0-4967-be35-a0ec6843838f from the EpiGuiId
> of the control you want to 'mirror')
>
> Now you use txtJobNumber.Text property

Interesting trick! I'll keep that one near-by.

I did have success with the EpiDataView route:

' Create a reference to the JobSerialView
Dim jwdv as EpiDataView = CType(oTrans.EpiDataViews("jobSerialView"),
EpiDataView)

' Create a string and assign the JobNumber for the current row
Dim strJob as String = jwdv.dataView(jwdv.row)("JobNumber").ToString()

This seemed to work. The reason I went this route is so I could try the bonus
question. I should be able to loop through the ssnView to get each serial
number on the screen but I haven't found any looping code yet...

Thanks Bernie!!!

Mark W.
Once all the S/Ns are in the data view:

Dim strSN As String

For Each dr As DataRowView in ssnview.dataView
strSN = dr.Row("SerialNumber").ToString()
Next

Of course you will have to define the references to the ssnview
dataview :)


--- In vantage@yahoogroups.com, "Mark Wonsil" <mark_wonsil@...> wrote:
>
> Bernie wrote:
> > Define a text box that will 'mirror' the form text box:
> >
> > Private WithEvents txtJobNumber
> >
> > In the form load event set your text box to 'mirror' the forms
text
> > box:
> >
> > txtJobNumber = CType(csm.GetNativeControlReference("46567b2e-6bc0-
> > 4967-be35-a0ec6843838f"), EpiTextBox)
> >
> > (you find the 46567b2e-6bc0-4967-be35-a0ec6843838f from the
EpiGuiId
> > of the control you want to 'mirror')
> >
> > Now you use txtJobNumber.Text property
>
> Interesting trick! I'll keep that one near-by.
>
> I did have success with the EpiDataView route:
>
> ' Create a reference to the JobSerialView
> Dim jwdv as EpiDataView = CType(oTrans.EpiDataViews
("jobSerialView"),
> EpiDataView)
>
> ' Create a string and assign the JobNumber for the current row
> Dim strJob as String = jwdv.dataView(jwdv.row)("JobNumber").ToString
()
>
> This seemed to work. The reason I went this route is so I could try
the bonus
> question. I should be able to loop through the ssnView to get each
serial
> number on the screen but I haven't found any looping code yet...
>
> Thanks Bernie!!!
>
> Mark W.
>