首页 > 其他 > 详细

不使用fastreport自带的条码组件打印快递单(一款很不错的条码组件下载)

时间:2017-11-09 21:37:29      阅读:303      评论:0      收藏:0      [点我收藏+]

由于没有正确安装fastreport组件,导致没法使用fastreport中的条码组件,如何解决:

思路:

1、虽然条码组件不能使用,但有fastreport中picture组件可用。

2、查找可以生成一维码图片的组件。通过寻找找到了Barcode(下载)

3、利用picture的filelink属性,在报表中加载第二步产生的条码bmp图片。

步骤如下:

一、设计报表

1、在fastreport设计器中加入picture组件

2、设置picture的FileLink属性:c:\barcode.bmp;

二、编写代码,利用Barcode组件,产生一维码:

var
  Barcode1: TAsBarcode;
begin
  Barcode1 := TAsBarcode.Create(self);
  Barcode1.Top := 0;
  Barcode1.Left := 0;
  Barcode1.Modul := 1;
  Barcode1.Ratio := 2.0;
  Barcode1.Height := 75;
  Barcode1.Text := ‘012345678’;
  Barcode1.ShowText := bcoCode;
  Barcode1.Typ := TBarcodeType(5);
  Barcode1.ShowTextPosition := TShowTextPosition(5);
  Barcode1.Modul := 3;
  try
        Barcode1.Angle := 90;
    except
        Barcode1.Angle := 0.0;
    end;
  Image1.Picture := nil;
  Barcode1.DrawBarcode(Image1.Canvas);
  Image1.Picture.BITMAP.SaveToFile(‘c:\barcode.bmp‘);//(同FileLink属性一致)
  frxReport1.LoadFromFile(‘xxx.fr3‘);
  frxReport1.PrepareReport;

  frxReport1.PrintOptions.ShowDialog := False;
  frxReport1.Print;

不使用fastreport自带的条码组件打印快递单(一款很不错的条码组件下载)

原文:http://www.cnblogs.com/windel/p/7811222.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!