C#调用bartender打印标签配置和测试说明教学文案.docxVIP

  • 48
  • 0
  • 约7.78千字
  • 约 8页
  • 2020-04-19 发布于浙江
  • 举报

C#调用bartender打印标签配置和测试说明教学文案.docx

C#调用bartender打印标签配置和测试说明 C#调用bartender打印标签 第一部分:配置说明 //useLegacyV2RuntimeActivationPolicy = true;在app.config中添加一个配置节:startup //增加引用,BarTender 10.1 和Seagull.Bartender.Print 两个引用.dll文件 //一个两个方法(用数据库和具名数据源作为区分) //方法1:配置如下 //标签test1.btw 设置为具名数据源(数据源类型为镶入的数据)同时配对每一个输出标签格 //方法2:配置如下 //标签test.btw 设置为数据库(以excel为数据库)同时配对每一个输出标签格 第二部分:界面和代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Seagull.BarTender.Print; using System; using System.Diagnostics; using System.Drawing.Printing; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } //useLegacyV2RuntimeActivationPolicy = true;在app.config中添加一个配置节:startup //增加引用,BarTender 10.1 ,Seagull.Bartender.Print 两个引用 private void button1_Click(object sender, EventArgs e)//输入内容后选择打印机 { BarTender.Application btApp = new BarTender.Application(); BarTender.Format btFormat; btFormat=btApp.Formats.Open(@d:\test1.btw,false,); btFormat.PrintSetup.IdenticalCopiesOfLabel=1; btFormat.PrintSetup.NumberSerializedLabels=1; btFormat.SetNamedSubStringValue(StyleNo, this.StyleNotext.Text); btFormat.SetNamedSubStringValue(HelpCode, this.HelpCodetext.Text); btFormat.SetNamedSubStringValue(ProductCategoryName, this.ProductCategoryNametext.Text); btFormat.SetNamedSubStringValue(MetalPurityName, this.MetalPurityNametext.Text); btFormat.SetNamedSubStringValue(MaterialTypeName, this.MaterialTypeNametext.Text); btFormat.SetNamedSubStringValue(RingSize, this.RingSizetext.Text); btFormat.SetNamedSubStringValue(Weight, this.Weighttext.Text); btFormat.SetNamedSubStringValue(StoneQuantity, this.StoneQuantitytext.Text); btForma

文档评论(0)

1亿VIP精品文档

相关文档