现至下面网站下载 Zen.Barcode.Core.dll

http://barcoderender.codeplex.com/

 

将此dll加入专案中

报表对应Barcode的显示栏位设定为Byte阵列

Public Class CWork
Public Property id As String
Public Property size As String
Public Property name As String
Public Property BarcodeImg As Byte()
End Class

 

 

资料结合报表SampleCode:

Dim list_Detail As New List(Of CWork)
For i = 0 To 2
Dim l_en As New CWork
l_en.id = i.ToString("000")
l_en.name = "555-" + l_en.id
Dim l_fy = BarcodeDrawFactory.Code128WithChecksum
'change biteArr
l_en.BarcodeImg = fybase.FormFy.FyUtility.imageToByteArray(l_fy.Draw("1234567" + i.ToString(), 20), Drawing.Imaging.ImageFormat.Jpeg)
l_en.size = "very big"
list_Detail.Add(l_en)
Next

'装Report资料来源
ReportViewer1.Visible = True
Dim rds1 As ReportDataSource = New ReportDataSource("barcode", list_Detail)
ReportViewer1.LocalReport.DataSources.Clear()
'ReportView依照Report大小控制
ReportViewer1.SizeToReportContent = True
ReportViewer1.LocalReport.DataSources.Add(rds1)
ReportViewer1.LocalReport.Refresh()

 

结果如下:

barrrrrrrrrrrrrrr  

 

 

 

相关文章