跳到主内容

搜索

搜索

vb.net QueryPrompts

评论

6 条评论

  • Avatar
    Peter Thane

    I think the issue is you are not declaring the name of the query prompt correctly. This old forum post may help

    https://support.seagullscientific.com/hc/en-us/community/posts/216561527-Query-Prompt-Vb-net

    0
  • Avatar
    Wolfgang Bornatowicz

    Hi Pete,

     

    thanks for the answer.

    What can be wrong if i use the index 0? I just have 1 query prompt and i see the index 0 in the collection?

    btFormat.DatabaseConnections.QueryPrompts(0).Value

    Thanks

    Wolfgang

    0
  • Avatar
    Peter Thane

    From Ian's earlier answer it looks like it should be specified like the below where you actually declare the name of the query prompt and sets its value:

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

    If you haven't renamed the Query Prompt then it would be called "QueryPrompt1" I believe by default. 

    0
  • Avatar
    Wolfgang Bornatowicz

    Even if i use 
    btFormat.DatabaseConnections.QueryPrompts("Abfrage-Eingabe1").Value = "9003719142925"
    it didn't give me the expected label

    0
  • Avatar
    Peter Thane

    I just noticed the export image command. As there is no print command I believe BarTender is therefore not processing the record selection and so the image you are getting will be the same one you would see when you open BarTender (ie the first record in the database only) 

    0
  • Avatar
    Wolfgang Bornatowicz

    OK, after research i try it with the print command, but than it would print about 2000 pages, not only one. This is my current, simple code:

    Dim path As String = "C:\CS\Firma\Projekte\Softwerk\Neuhofer\Files"
    Dim LabelName As String = "BND-COM-Bund_DOW14.btw"
    Dim File As String = IO.Path.Combine(path, LabelName)

    Dim btFormat As LabelFormatDocument = engine.Documents.Open(File)

    btFormat.Activate()
    btFormat.DatabaseConnections.QueryPrompts(0).Value = "999999999"
    Dim r As Result = btFormat.Print("Test")

    999999999 is unique in the csv. What could be wrong?

    0

请先登录再写评论。