Skip to main content

Search

Search

Format.cancelprinting

Comments

9 comments

  • Avatar
    Fernando Ramos Miracle
    Moderator

    Hello Peter,

     

    1. Could you let me know on what type of VB Script you've entered the code (document level, data source or "OnProcessData" from the "Transforms" tab).

     

    2. If using an event based VB script, on what event are you entering your code?

     

    3. Could you attach a simplified version of your document so I can test your script?

     

    Regards.

    0
  • Avatar
    Legacy Poster

    Thanks for your answer, the label is attached.

     

    Regards,

     

    Peter

    0
  • Avatar
    Fernando Ramos Miracle
    Moderator

    Hello Peter,

     

    I'm afraid I haven't been able to reproduce your issue, and I can't see anything wrong with your code.

     

    Could you let me know exactly where are you printing from? Are you working with BarTender directly, or are you maybe using Print Station?

     

    As a possible solution, you might want to try changing your VB Script to an "Event Based VB Script" and add your code to only one event (maybe "OnPrintStart"). This way you can make sure the code will run only once.

     

    Regards.

    0
  • Avatar
    Legacy Poster

    Hi Fernando,

     

    Putting the script in the "Event based VB script" (OnPrintStart) works, however when I change the date field to a supplied input field (date picker) an error comes up (attached)

    Hope you can help me out.

     

    Thanks!

     

    Peter

     

    0
  • Avatar
    Fernando Ramos Miracle
    Moderator

    Hello Peter,

     

    Could you attach the latest version of your document so I can try reproducing your error message?

     

    Thanks!

    0
  • Avatar
    Legacy Poster

    Hi Fernando,,

     

    Here's the label, date field works, when changing to supplied input the former script error appears.

     

    Thanks!

    0
  • Avatar
    Legacy Poster

    Hi Fernando,

     

    Did you had a chance to take a look at the attached label with the date selector?

     

    Thanks!

    0
  • Avatar
    Fernando Ramos Miracle
    Moderator

    Hello Peter,

     

    Sorry for the delay.

     

    I've been taking a closer look to your issue and it certainly looks like an issue with our software. The problem is not about a type mismatch (although that's the symptom) but that when assigning a variable with the value of a named data source on the OnPrintStart event the variable stays empty. I've already reported it to our development department so we'll hopefully solve it soon.

     

    In the mean time, and for your script to work, try pasting the script (as it is) in a different event; such as OnPostPrompt or OnPrePrompt events if you wish the cancel after or before the actual prompt respectively.

     

    *Tried them both with your document and they certainly work.

     

    Regards.

    0
  • Avatar
    Legacy Poster

    Hi Fernando,

     

    Thanks! OnPrePrompt was the right event, working perfectly now, case closed  :)

     

    Regards.

    0

Please sign in to leave a comment.