Skip to main content

Search

Search

Database Process By Global Function

Comments

3 comments

  • Avatar
    Legacy Poster

    In the hopes of helping others:

     

    No matter what i tried the even without any Templates using just a single label the visual basic was not passed the correct field but directly accessing the field works fine.  So in the end i started looking for other ways of doing it.

     

    In the end I managed to 'work around' this by using a Database field that uses VBScript to transform the data; parsing out the required tag(s).

     

    using the following methodolgy:

     

    Created the text item as

        Type: Data Base Field,

        Column: DespatchMeta

     

    Added a Transform onto the Text/Properties/Transform Tab:

       Type: Use VB Scripting

       Functions And Subs:  The simple tag extract function FindXml

       OnProcessData:  Value=FindXml(Value,"addr1")

       

     

    One point of note I often see the Common functions as Global, they are NOT.  They are COMMON to the SECTION of bartender you are working with from what i can tell. So if you set Common Functions for the document events, the document events can use it.  But the one for the Transform for Text boxes can not.  Its very counter intuitive and all very messy IMHO but it is what it is I guess :(  In this case its even worse because it means i have to copy and paste the 'common' function into every single 'common' text box that wants to use?!!?!

     

     

    Hope this helps.

    0
  • Avatar
    Legacy Poster

    Dave,

            Your scenario is a bit like some of mine in that they can be quite complicated and difficult to explain in a forum post! It seems that sans your implementation, the crux of your question is about whether global code can be loaded for BarTender application-wide in scope, or even entire label-scoped, and you've found that it appears to not be the case. Maybe Seagull techs will have a response to that one. I would think that there might be a lib path that code could be saved to within the application folders to be included, but that's just optimistic thinking. :)

     

           One route you can take (as I have at times) is to perform your scripting outside of BarTender, and call it's objects to trigger printing.

     

    On a side note, since there are always many ways to accomplish a particular task, it sounds like you could perform the selection of the different label formats you have and trigger its printing via Commander by just dropping an XML file in your polling directory...  Just thoughts.

     

    Travis-

    0
  • Avatar
    Legacy Poster

    Thanks MightyGorilla (cool name!) for your answer/suggestions - yes its a bit horrendous really but it was the only way I could see to get the speed we required an order of 10x faster at least than loading up separate docs.  I did passingly think about using a DLL of some sort and exposing an entry point for the parser but the whole thing would mean a dependency on yet another file, something i am really rather not too keen on and don't have the time for at this point.

     

    We do some driving of Bartender but I simply don't have the time to script it all outside of BT as this is just a seemingly tiny part   :rolleyes:   of a much larger project.

     

    I too would be interested to hear from bartender on this, as it seems like a real headache to get vbscript  code that can be re-used all over bartender. The best i have managed so far is a component, but that just makes copies all over the place.  I am guessing the only true way is a plugin DLL of some sort.  However,  If i don't see any answer on here in a few days I will raise the case through our Support contract as we need an answer to this one really for future reference.

    0

Please sign in to leave a comment.