跳至主內容

搜尋

搜尋

Print Multiple Labels From Vb.net

評論

6 條評論

  • Avatar
    Shotaro Ito

    I would export the datagrid to CSV file then use BarTender's database connection setup to connect to the CSV file.

     

    To connect CSV file and print, this topic might helps(though this is by C#)

    http://forums.seagullscientific.com/index.php?/topic/525-sample-code-create-and-assign-csv-database/

     

    Number of copies can be specified in database field.

    Open btw file by BarTender, from Print dialog > Quantity > Copies property, specify database field (such as Quantity)

    0
  • Avatar
    Legacy Poster

    Hi,

    by using the direct print command instead of the preview I managed to print multiple selected labels directly from the datagrid. (See code in attachment)

     

    But there is still one problem: some labels have a size dependancy. The label contains a size queryprompt. Is it possible to send the size value from vb.net to the queryprompt?

     

    0
  • Avatar
    Shotaro Ito

    Thanks for sharing. Query prompt can be set like below.

    'Select the query prompt'
    
    btQueryPrompt = btFormat.Databases.QueryPrompts.GetQueryPrompt("Name")
    
    'Set the value of the query prompt'
    
    btQueryPrompt.Value = "Jane Doe"
    

    When printing several times in a loop, you could start BarTender application before the loop and quit after the loop for faster printing.

    0
  • Avatar
    Legacy Poster

    Hi,

     

    thanks very much that solved my problem.

    You're right about starting Bartender once at the beginning of the loop and quit after the loop is finished.

    Is there perhaps a vb.net example available how to start the Bartender application and how to handle error messages from Bartender?

    0
  • Avatar
    Shotaro Ito

    If you haven't, please check Online help > Automating BarTender > Automation with Active X > Examples of using ActiveX automation.

    http://help.seagullscientific.com/10.1/en/#../Subsystems/ActiveX/Content/printing_formats.htm

    0
  • Avatar
    Legacy Poster

    Hi again,

    I managed to print the labels directly from the datagrid in vb.net but there is still a small problem.

    Some labels get the amount of labels to print from the datagrid but some labels use an ODBC connection to get the amount of labels to print.

    Is there a way to check if the label gets the amount to print from an external source?

     

     

    0

登入寫評論。