zoukankan      html  css  js  c++  java
  • vb 条形码打印,crystal Report 纵向排列:多列格式化

    一个label就是一条detail,分布成4列16行,用A4纸打印。

    这与通常的报表有点不一样,通常报表的明细都是一条一行;而现在要每4条放在一行,这需要用到“多列格式化”属性。

    先说打印条码的吧,条码图片怎么来?

    下载生成条码的exe文件Barcode.exe以及dll文件Zen.Barcode.Core.dll,通过shell函数调用执行Barcode.exe文件生成条码图片

    在给报表传数的table里面插入条码图片:

    Private Sub AddBarcodeImages(ByVal DTab As DataTable)
            If Not DTab Is Nothing Then
    
                DTab.Columns.Add("BCIMAGE", Type.GetType("System.Byte[]"))
    
                Dim r As DataRow
                For Each r In DTab.Rows
    
                    Try
                        Dim BatchNo As String = r.Item("Line_No") & "-" & CStr(r.Item("Operator")).Trim
                        Dim sFileName As String = "C:\TEMP\" & BatchNo & ".jpg"
    
                        Shell("Barcode.exe " & BatchNo & " 36", AppWinStyle.NormalFocus, True)
    
                        Dim fs As IO.FileStream = New IO.FileStream(sFileName, IO.FileMode.Open)
                        Dim fi As IO.FileInfo = New IO.FileInfo(sFileName)
                        Dim fl As Long = fi.Length
                        Dim lung As Integer = Convert.ToInt32(fl)
                        Dim imgBytes As Byte() = New Byte(lung - 1) {}
                        fs.Read(imgBytes, 0, lung)
                        fs.Close()
                        r.Item("BCIMAGE") = imgBytes
    
                        Dim f As IO.File
                        Try
                            f.Delete(sFileName)
                        Catch ex As Exception
                            Console.WriteLine(ex.ToString)
                        End Try
    
                    Catch ex As Exception
                        'MessageBox.Show(ex.ToString)
                    End Try
                Next
            End If
        End Sub


    获取条码图片后传递数据给报表,报表的设计:

    vinson
  • 相关阅读:
    Oracle DBA手记3:数据库性能优化与内部原理解析
    产品部和业务部门的利益之争
    利用dir函数查询各个数据类型的方法
    Python自动单元测试框架
    十一长假归来
    我心爱的TT被我擦到了,伤心!
    150首现代最流行的歌曲连放
    Increase bugzilla attachment size
    Python中的搜索路径
    抛出异常
  • 原文地址:https://www.cnblogs.com/vinsonLu/p/3077570.html
Copyright © 2011-2022 走看看