Foxtable(狐表)用户栏目专家坐堂 → [求助]Excel模板如何设置条形码图片?


  共有15792人关注过本帖树形打印复制链接

主题:[求助]Excel模板如何设置条形码图片?

帅哥哟,离线,有人找我吗?
狐狸爸爸
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47448 积分:251054 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/7/14 17:43:00 [显示全部帖子]

空行的问题可以这么解决:

 

if e.DataRow isnot Nothing AndAlso e.datarow.IsNull("lot") = false then

   Dim Bar As New BarCodeBuilder
   Bar.Symbology = Barpro.Symbology.Code39
   Bar.Code = e.DataRow("Lot")
   Bar.BarRatio = 0.3
    Bar.BarHeight = 8
    bar.SaveImage(ProjectPath & "Images\BarCode.gif",300)

Else

   filesys.DeleteFile(SaveImage(ProjectPath & "Images\BarCode.gif")

end if


 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47448 积分:251054 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/7/14 22:33:00 [显示全部帖子]

这样不会报错了:

 

If e.Book.TempLate = "SalesInvoice" Then
    If e.region = "SaleOrderDetail" Then
        If e.DataRow Is Nothing OrElse e.DataRow.IsNull("Lot") Then
            Dim img As New System.Drawing.Bitmap(1,1)
            img.Save(ProjectPath & "Images\BarCode.gif")
        Else
            Dim Bar As New BarCodeBuilder
            Bar.Symbology = Barpro.Symbology.Code39
            Bar.Code = e.DataRow("Lot")
            Bar.BarRatio = 0.3
            Bar.BarHeight = 8
            bar.SaveImage(ProjectPath & "Images\BarCode.gif",300)
        End If
    End If
End If

 

但是空行还是会出现条形码,这个需要等下次更新。


 回到顶部
总数 13 上一页 1 2