Serialize Based Off Of Number Of Rows In Txt
I need to print "Carton 1 of 10" type text.
The 10 could be any number, but would be equal to the number of rows of data in my TXT file. Each row would would have the Carton number change by 1.
I can't seem to grasp how to do this.
Anyone have any ideas?
The 10 could be any number, but would be equal to the number of rows of data in my TXT file. Each row would would have the Carton number change by 1.
I can't seem to grasp how to do this.
Anyone have any ideas?
0
-
Hi, Polysci :
If you have professional or above edition, you can achieve this
1)Dragging Bartender "Components" toolbox -> Samples-> Seralization-> Label X of Y into the design area
2)File-> Print-> Quantity tab, put 10 or the number of rows in your database you wish to seralize into Number of Seralized Labels
If you have Basic edition, you can use "X" "of" "Y" as three separate screen data(since Basic does not have sub-string function)
1)Create three screen data for "X" "Of" "Y"
2)Double click on "X"-> More Option-> Seralization-> tick "Seralize" checkbox
3)File-> Print-> Quantity tab, put 10 or the number of rows in your database you wish to seralize into Number of Seralized Labels
4)In Y, put the number you want to seralize
You can also put a print prompt to let user input seralization number depend on your process.
Thanks!0 -
Legacy Poster
★ BarTender Hero ★
Hi Susan,
I have BT Enterprise.
The issue is that the text file could have any number of rows. One row for each label. The text file is ftp'd from a UNIX system to a Windows server, so there is no opportunity for a prompt. No one would ever see it.
Either the software can count the number of rows and make that the Serial Labels value, or it needs to be passed in somehow.
Thanks!0 -
Legacy Poster
★ BarTender Hero ★
Putting this code in the field for total boxes under Source: Visual Basic Script. Type: Event Control Scripts will make the value of that field equal to the number of lines in the referenced text file. Put it under the event you want. Probably OnPrintStart would work.
The .txt file is in the same folder as the .btw file in my test. Haven't tested if putting a full path in there works if they're in different directories.
[code]const filename="Count.txt" 'make your input
set fso=createobject("scripting.filesystemobject")
set ofile=fso.opentextfile(filename)
strcontents=ofile.readall
ofile.close
set ofile=nothing
set fso=nothing
acontents=split(strcontents,vbcrlf)
Value= cstr(ubound(acontents)+1)
[/code]
After that, just have the file default to printing the entire database, and have the number that is "Box X of..." serialize on each record.0 -
Legacy Poster
★ BarTender Hero ★
nRyder,
Thanks a lot. That worked with these two points.
Used the OnAutoSelected event and took out the +1 on the Value=catr(unbound(acontents)+1). It was one over record count for me.
Polysci0
請登入寫評論。
評論
4 條評論