基于.Net下整合FastReport,实现条码标签批量打印

一. 准备工作

  1. 点击此下载支持.Net4.0的 FastReport ,安装后并破解

  2. VS2012 工具箱中,新建选项卡,添加 %安装目录%Framework 4.0FastReport.dll 选项

    可在选项卡下查看到如下图,表示整合成功

  

二. 相关文件介绍

  1. 在 %当前用户%AppDataLocalFastReport 下找到 FastReport.config,修改 Language 标签进行汉化

<Language Name="Chinese (Simplified)" Folder="reportLocalization"/>
View Code

  2. 利用 %安装目录%Designer.exe 设计报表文件,如 barCode.frx

    设置两列标签方法,选择 报表---页面设置---列,设置数量为 2

  3. VS2012 中winform中添加 Report 组件

  4. 打印代码

repBarCode.Load(Application.StartupPath + @"
eportarCode.frx");
IList<BarCode> ds = _bllPurchase.GetForBarCode(Purchase.table, purchaseGuids.Substring(0, purchaseGuids.Length - 1));
repBarCode.RegisterData(ds, "inven");

//给DataBand(主表数据)绑定数据源
DataBand masterBand = repBarCode.FindObject("Data1") as DataBand;
masterBand.DataSource = repBarCode.GetDataSource("inven"); //主表

repBarCode.Show();
View Code

三. 效果展示

原文地址:https://www.cnblogs.com/Mr-kevin/p/8269012.html