Pass .net Variable To Label Format ? V9.3 Follow


Am I able to pass a variable from my VB.NET application to appear on my Label Format?


My Label format(s) currently have 2 query prompts, one to identify the SQL DB record to use and one for quantity to print.


On occasion, the user will need to input an Order No. for it to appear on the label(s).


I was hoping to add a text object to my label format with a new query prompt as the data source, I can then pass the Order No. variable to the new query prompt?


Any help would be very welcome.


Many thanks


Legacy Poster
Comment actions Permalink

Hi DaveC,

Sorry you didn't get help sooner. 

I'm a new Bartender user (just installed it a new hours ago), but I found the examples you'll need.

When you install Bartender, be sure to install Automation version (or Enterprise Automation). During the install, select advanced and check the option to install .NET SDK examples. Once installation is completed you'll find a folder installed on your system "Bartender .NET SDK". Open that and look in "Print Engine API Samples" > "LabelPrint". You'll find projects for both C# and VB. The path on my machine is "C:\Program Files\Seagull\BarTender Suite\SDK\Print Engine API Samples\LabelPrint" but it may be different on yours depending on where you installed.

If I was Seagull I'll just put these sample apps on github. then the community should more easily discuss and maintain the code with issues trackers and pull requests.


Legacy Poster
Comment actions Permalink

Also in the BarTender .NET SDK Documentation see "Changing Text and Barcode Data on the Label Format"

Modifying Named Substrings
Named substrings not only can be read, but they can be modified programmatically. The following code demonstrates how to modify named substrings.
In C#:


Engine btEngine = new Engine(); 

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

btFormat.SubStrings["Address"].Value = "1313 Mockingbird Lane, Anywhere, USA"; 

btFormat.SubStrings["Name"].Value = "John Doe"; 

btFormat.SubStrings["Quantity"].Value = "10"; 

Please sign in to leave a comment.