- 48
- 0
- 约7.78千字
- 约 8页
- 2020-04-19 发布于浙江
- 举报
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
您可能关注的文档
最近下载
- 2025年江苏城乡建设职业学院单招职业技能考试题库(历年真题).docx VIP
- FORUS体系应知应会(1)(1).docx VIP
- 《马克思主义基本原理概论》期末试卷及答案.pdf VIP
- 2023届四川省成都市青羊区石室联中学数学八下期末调研试题含解析.doc VIP
- 2025级安全技术与管理专业人才培养方案.docx VIP
- 公路沥青路面施工技术规范.doc VIP
- 人教版2026-2027学年三年级下册道德与法治教学工作计划(及进度表).docx
- 吴梧桐主编《生物制药工艺学》学习笔记讲课教案.pdf VIP
- 通用版高一综合实践 研究性学习--如何选题 课件(25张PPT)(含音频+视频).ppt VIP
- 2024届四川省成都市青羊区石室联中学物理八下期末考试模拟试题含解析.pdf VIP
原创力文档

文档评论(0)