Jump to content

gicandles

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by gicandles

  1. Adventurer, Thanks for the post. I did not see it until after I posted my solution. To tired at the moment to go through it in great detail, but it looks like I ended up doing something very similar. I appreciate the help and will review a little closer in the morning. Thanks.
  2. Arg. Never fails. When I ask I figure it out. Here is what I finally did. If anyone has any improvements or suggestions please send them my way. First here is the structure of my data after import with _XLSXReadtToArray $ClientList[0][0]:=2 $ClientList[0][1]:= $ClientList[0][2]:= $ClientList[1][0]:=Name1 $ClientList[1][1]:=Tag $ClientList[1][2]:=Date Effective $ClientList[2][0]:=Name2 $ClientList[2][1]:=Tag2 $ClientList[2][2]:= Obviously this is just a sample file for test purposes. What I was looking to do was have 2,1 3,1 4,1 5,1 etc display in a combo box, and then have the corresponding 2,2 3,2 4,2 5,2 etc sent on to my print script. First I used the following two functions to create the array and then to create a var with the data to load into the combo box. Func _LoadClients () $t = TimerInit() $ClientList = _XLSXReadToArray("L:\Databases\clients.xlsx") $Error = @Error $Extended = @Extended $t = TimerDiff($t) ;~ ConsoleWrite("Timer = " & $t & @LF) ;~ ConsoleWrite("Return = " & $ClientList & " - $Error = " & $Error & " - $Extended = " & $Extended & @LF) EndFunc Func _DisplayClientName () $s = $ClientList[0][0] For $i = 1 To $s Step 1 $list123 &= "|" & $ClientList[$i][0] Next EndFunc Next I loaded both functions sequentially when the GUI with the print interface is loaded (Actually when the button is pushed to open that GUI) I also had the same button load the $list123 into the combo box with GUICtrlSetData($privateComboList, $list123) Finally when my user clicks the "print" button on my GUI it calls the following script Func _SearchClientTag () $ClientName = GUICtrlRead($privateComboList) ConsoleWrite ("Begin Search"&@LF) ConsoleWrite ($ClientName & @LF) $result = _ArraySearch($ClientList, $ClientName) ConsoleWrite ("error code is: " & @error & @LF) ConsoleWrite ("Client Name is : " & $result & @LF) $aftertag = $ClientList[$result][1] ConsoleWrite ("The Tag line is: " & $aftertag & @LF) EndFunc $aftertag is a global variable I have set that is later used to replace a identifier in an xml file that triggers the actual printing. Also I should note that I have declarded $ClientList and $list123 as globals elsewhere. Hope this helps someone.
  3. I would appreciate a little help. I would like to use this to do the following: I have designed a system for selecting the proper label to print and send the print commands to the correct label printer. This part I have done with no problems. Now I am adding a part that allows the user to select a Client name from a xlsx file and the system then sends the data (tag line like www.client1.com) to the printer. I can set it up to that it prints fine. What I am having difficulty with is populating a combo box with the names in column 1 and then having it save the value of column 2 from the row of the selected client in the combo box into a variable. I can display the individual cells and then save a specific cell to a variable, but the problem that I am having is the linking. The part where it automatically searches for the tag line in the same row and saves it to a variable. I also must admit that I don't understand how to use the $cols and $rows flags above. Any additional insight would be much appreciated. I tried to read through your code to see if I could gleam anything, but I am just not familiar enough to do so with any success. Thanks for any help or suggestions you can come up with.
×
×
  • Create New...