Multiple Columns Of Data, Excel File 关注
BT 10.0 SR1 Enterprise Automation
Servers are either Win 2008R2 or Win 7, 64-bit
Clients are a mix of Win XP and Win 7.
Very new to BT, and a search showed no obvious answers, but I may have missed it.
I am attempting to print multiple pieces of data onto a label. If I perform a DB connection setup and associate the desired fields, using the BT thick client, I get close to what I want. I can scroll through the records to get the appropriate label. Ugly, but workable. (I haven't found a workable way to use a drop down list or text entry field to select a product and have it populate the SKU.)
The real challenge is that we are wanting to use Web Print Console to have the operators get access, but the above method doesn't work at all with WP. You can see the first label only.
I do have a vbscript which allows me to create a drop down list, but that only populates one field of data, and I am not knowledgeable enough with vbscript to have it populate the second field based on the content of the drop down list.
My data source is an excel spreadsheet with two columns of data: product and SKU. When I select the 'product' from the drop down, I want the SKU to be printed for that product as well.
Here is the vbscript used to select the product:
''''''Dimension object variables
''''''Get the path to the label (and excel file)
''''''Set this value to nothing to start, otherwise Sample Text will be in our dropdown list
value = ""
strConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & labelPath & "\label-data.xls;Extended Properties=Excel 8.0;"
Set objConn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
''''''SQL Select Statement
sqlStr = "SELECT PRODUCT FROM [TABLE_NAME$]"
rs.Open sqlStr, objConn, adCmdText
''''''Go to the first record, read the cells until its reaches the end of the set
do while not rs.EOF
value = value & rs.fields("PRODUCT") & vbcr
''''''Close the connection
Set rs = Nothing
''''''Remove the carriage return from the end of the value
value = Left(Value, Len(Value)-1)
Thanks for any assist you might be able to provide.