Skip to main content

Search

Search

Serialize Based Off Of Number Of Rows In Txt

Comments

4 comments

  • Avatar
    Susan Chen
    Moderator
    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
  • Avatar
    Legacy Poster
    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
  • Avatar
    Legacy Poster
    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
  • Avatar
    Legacy Poster
    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.
    Polysci
    0

Please sign in to leave a comment.