ireport 生成一维码 和 二维码 小记

来源:互联网 发布:营造清朗的网络空间 编辑:程序博客网 时间:2024/06/05 20:05

1、添加图片组件

图片组件


2、修改组建 属性 Image Experssion

设置图片生成

3、生成方式

一维码 ($F{WAYBILL_NO} 为条码数据)com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage(new com.google.zxing.oned.Code128Writer().encode($F{WAYBILL_NO},com.google.zxing.BarcodeFormat.CODE_128,188,40))

二维码 ($F{WAYBILL_NO} 为条码数据)com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage(new com.google.zxing.qrcode.QRCodeWriter().encode($F{WAYBILL_NO},com.google.zxing.BarcodeFormat.QR_CODE,200,180))

4、使用此方法,项目需添加 zxing 的jar包

如何打印成PDF可看本人博客

0 0
原创粉丝点击