Printing with OnNewRecord Script
Hi I'm using the document level events to move certain objects while printing from a database connection. The movement is based on one of the database values. I currently have the code in the document level scripts under OnNewRecord though I have tried it in all of the others as well.
The code runs correctly but one page late. For Example:
Page 1 prints
Code is run for page 1
Page 2 prints
Code is run for page 2
I need the code to run before printing each page is there a way to do that?
-
Hi Derek,
Welcome to the BarTender Community Forum!
Could you share a screenshot of the code and the location where you dropped it?
Also, what you are trying to accomplish seems like something which could be easily done by using Integration Builder. If your BarTender edition supports the Integration Builder, we would recommend using this app as it can automate the printing process.
You can find some samples of integrations made with Integration Builder below:
https://www.youtube.com/embed/5TRaYwwXmIw
We also have a Professional Services team, who in exchange for a quote, can help you with Visual Basic scripting for BarTender. You can reach them at the following email address: ProfessionalServices@SeagullScientific.com.0 -
Derek Daniels
★ BarTender Hero ★
Hi Xabier, and thank you. I have watched the video you attached and looked at integration builder but I didn't see where this would help. I'm entirely new to integration builder though so it's probably my unfamiliarity causing the problem there.
With the code I am trying to space evenly 6 objects during the printing process. 2 of the fields will be empty (Cert and PO) for different records on occasion. If one or both of the fields are empty I want them ignored while the rest are spaced. The best I can explain it for how I have it set up is the code seems to run as it should just at the wrong time.
1) Database record 1 is read
2) Database record 1 is printed
3) Code is ran for database record 1
This causes the spacing to be off for the next record if the Cert or PO fields are not the same as the previous record. Sometimes they overlap or have a big gap in between.
0 -
Paweł Gancarz
★ BarTender Hero ★
Hello Derek
I don't know if I understood you correctly, because I created something similar once.
If I have a value in the database after scanning the code, it searches the database for it and then inserts this record for printing.
You must add a quarenda and bind it to a field in the database.
You create the script in the quarenda. I've given you a sequence of pictures.
If there is nothing in the field to print it does not print it.
You have "4" there in the example because "1" is all there.0 -
Peter Thane
★ BarTender Hero ★
I do not think you need to use VB at all, but could create 3 templates in the same label and use conditional printing to achieve this, that sounds like what you are trying to achieve:
My label has 3 templates all linked to the same simple data file with 5 fields (f1 to f5) but field 3 and sometimes field 4 too is blank.
In BarTender I have created 3 templates on the label, one with 5, 4 and 3 text fields spaced out inside a box to make it easier to see the spacing. Each template only prints in certain conditions, the 5 line template, is fields 3 and 4 are not blank, 4 line if field 3 is blank but 4 is not and the 3 line if both 3 and 4 are blank. Such as
The text line at the top is to show which template is in use on the screenshot above.
0
Please sign in to leave a comment.
Comments
4 comments