Named data sources in BTXML file not being passed to VB script in template
Hi!
I have a label template in BT 2022 R4 with several Named Data Fields that populate fine from a BTXML file, but the label template fields that contains a VB Script in the TRANSFORMS tab do not get populated because the named fields in the BTXML that are referenced in the VB never make it there.
All this VB Script does it decide to print a named field only if it is not null, and then add a CR to the end of each line it ends up printing.
Note that it is not the IF stmt that is choosing to not print the fields as I removed the IF's and it still failed to print anything.
Based on an article on Seagull's site regarding FORCING Named Data fields to be recognized in VB scripts, I added the ReferenceSharedSubString("<blah>") lines to the beginning of the script (see pic) and now it gives me the following error: OnProcessData (Line 1): Type mismatch: 'ReferenceSharedSubString'
As I mentioned already, all the other template fields referencing named data sources pull their data just fine from the BTXML files.
Here is a pic of my VB script:
Thanks everyone!
-Greg
-
Not sure but it could be the VB is being run before the data is there to use, if that makes sense.
Have you tried adjusting the VB to Event Controlled VB routines say OnIdenticalCopies and see if that resolves the issue, as the VB is actioned later in the print routine.
0 -
Hi Peter!
Thanks SO much for your reply!
The frustrating thing is that Seagull says to add the ReferenceSharedSubstring statement at the top to force it to recognize the Named fields and fix the exact issue I'm having, but when I added it I get the error immediately when trying to just exit the VB scripting page in Designer :(
I'm very rusty on VB coding so I'm not familiar with how to do what you suggested...? :)
-Greg
0 -
I am just wondering if you are making it too complicated for yourself.
Couldn't you do something like this:
This actually prints like this
The bottom fields are the Named fields and do not need to be on the label or you could probably use those as the strings themselves in the Normal Wrapped text object rather than using the Object Value that I have used for each one.
I have added, between each sub-string, a Carriage Return which is suppressed if the next/following sub-string is empty and you can see the result of this in the printed sample above where Addr2 is blank.
0
Please sign in to leave a comment.
Comments
3 comments