Skip to main content

Search

Search

Passing Of Data From Vb.net To Bartender

Comments

3 comments

  • Avatar
    Domingo Rodriguez
    Moderator

    Firstly, you will need to setup a query prompt for the database connection created inside the BT document (if you haven't done that yet):

    http://www.bartenderbarcodesoftware.com/label-software/training-video-(selecting-records-from-a-database-at-print-time).aspx

     

    Now, after the query prompt has been created, you will need to fill the query prompt value at print time:

     

    In C#:

     

    Engine btEngine = new Engine();

     

    // Start a BarTender Engine process

    btEngine.Start();


    // Open a label format

    LabelFormatDocument btFormat =
    btEngine.Documents.Open(@"c:\MyLabel.btw");


    // Set the QueryPrompt

    btFormat.DatabaseConnections.QueryPrompts["Nutrition Calorie Data"].Value = "40
    Calories"
    ;


    // Print the label format

    Result result = btFormat.Print();

     

    In VB:

     


    Dim btEngine As
    New
    Engine()


    ' Start a BarTender Engine process

    btEngine.Start()


    ' Open a label format

    Dim btFormat As LabelFormatDocument = btEngine.Documents.Open("c:\MyLabel.btw")


    ' Set the QueryPrompt

    btFormat.DatabaseConnections.QueryPrompts("Nutrition Calorie Data").Value = "40
    Calories"


    ' Print the label format

    Dim result As Result = btFormat.Print() 

     

     

    Does this help?

    0
  • Avatar
    Legacy Poster
    Can I use 2 query prompts? 1st is for the partno 2nd is for the serialno?
    0
  • Avatar
    Legacy Poster
    Problem solved. I used substring because I don't know if I can use query prompt twice. But thanks anyway. =)
    0

Please sign in to leave a comment.