跳至主內容

搜尋

搜尋

Calculate Amount To Print By Formula

評論

6 條評論

  • Avatar
    Legacy Poster

    Nobody has an idea? :(

    0
  • Avatar
    Ian Cummings
    版主

    Create a named data source for your data entry item.  Let's call it "btPackages" for example.

     

    From the Print dialog choose to data source the print quantity for the number of copies and choose a "VB Script - Single Line Expression" for the data source type.  Edit the script and enter in the below expression:

     

    Format.NamedSubStrings("btPackages").Value *2

    0
  • Avatar
    Legacy Poster

    Thanks Ian, that did the trick!

    0
  • Avatar
    Legacy Poster

    Hi,

     

    I have a question regarding the same topic.

     

    I created a btw template file with several page templates,

     

    Templates include a header, a body (several different templates) and a trailer. in the body I'm choosing which template to use depending on a value in the database file (trigger file).

     

    The question is: is it possible to determine the amount of times a template page within the template needs to be printed by a value in the trigger file?

     

    example:

     

    header

    label 1

    label 2

    label 2

    label 2

    trailer

     

    Label 2 is printed 3 times due to a number 3 in the trigger file.

     

    Any help would be much appreciated.

    0
  • Avatar
    Ian Cummings
    版主

    juanktoro: Nope, it's not possible to data source the quantity to print for a single template in a document that contains multiple templates.  I guess that if the top number of variable quantity templates to print isn't too great you could have a separate template (copy) for each template that is to conditionally print, but of course such a solution isn't particularly scalable if you could have a great many "label" templates.

    0
  • Avatar
    Legacy Poster

    Hi

    I am very new to Bartender.  I am trying to calculate KGs based on a field BoxWt in a trigger file.  This file does not have headers.

    I have set up a share/name on the label format for the field BoxWt (set up as an integer)  and called that BoxWt also.  I am using the following formula to calculate Kgs:

    Round(CSng(Format.NamedSubStrings("BoxWt")* .4536),2)

     

    I get the error:

    OnAutoSelectedExpression(line 1): :Type mismatch: '[string: ""]'

     

    I get this error whether I use the CSng function or not.  It is not saying the field BoxWt is a mismatch, just the string: "".

     

    Can someone help me with the correct syntax for a Single-Line Expression to formulate this?

     

    Thank you

    0

登入寫評論。