入库单格式如下(表格部分如何实现):-----------------------------------------------
产品名称  |   产品规格  |   数量   |    金额   |
------------------------------------------------
  计算机  |    286      |   1      |   2000    |
------------------------------------------------
  计算机  |   联想天骄  |   2      |   9000    |
------------------------------------------------
          |             |          |           |
------------------------------------------------
          |             |          |           |
------------------------------------------------
   小计   |             |    3     |   11000   |
------------------------------------------------分组:  入库单内部ID
该入库单只有两条分录,我现在希望每页入库单的表格有五行,四行数据,最后一行为合计,
现在的问题是:如果入库单只有两条分录,那么下面两行空的表格线打印不出来,请问如何实现?在线等待
   

解决方案 »

  1.   

    没用过 activereport 一直感觉不好使 
    我用 vsgrid+vsprinter(无所不能)
      

  2.   


    以下是限定为10行的,,自已改一下.Option ExplicitDim i As Long
    Dim j As Long
    Dim lineCount As Long
    Dim k As Long
    Dim Addblank As Long
    Dim LastRec As LongPrivate Sub ActiveReport_Initialize()
        
        lineCount = 20  
        DataControl1.Recordset.movelast
        DataControl1.Recordset.movefirst
        LastRec = DataControl1.Recordset.RecordCount - 1
        Addblank = lineCount - DataControl1.Recordset.RecordCount Mod lineCount  
    End SubPrivate Sub Detail_Format()    k = DataControl1.Recordset.AbsolutePosition
            
        If (k + 1) Mod lineCount = 0 Then
            Detail.NewPage = ddNPAfter
            Me.LayoutAction = 7      
        Else
            Detail.NewPage = ddNPNone
            If k = LastRec Then
                'DataControl1.Recordset.MovePrevious
                For j = 0 To Fields.Count - 1
                    Fields.Item(j) = Null
                Next j
                              
                If i <= Addblank Then
                   Me.LayoutAction = 3
                   i = i + 1
                Else
                   Me.LayoutAction = 4
                End If
            End If
        End If
    End Sub