Print Multiple Labels From Vb.net
Hi All,
I have made a datagrid in vb.net to select the labels and the amount of labels that need to be printed (see attachment).
Is it possible to print all the selected labels form the datagrid at once, in just 1 print job?
What is the best way to do this? A vb.net example will be very helpfull.
-
Shotaro Ito
★ BarTender Hero ★
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 -
Legacy Poster
★ BarTender Hero ★
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 -
Shotaro Ito
★ BarTender Hero ★
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 -
Legacy Poster
★ BarTender Hero ★
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 -
Shotaro Ito
★ BarTender Hero ★
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 -
Legacy Poster
★ BarTender Hero ★
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
Iniciar sesión para dejar un comentario.
Comentarios
6 comentarios