可是要生成如下樣式報表如何用代碼啊??????
_______________________
| 組:AQ              |   組    
|---------------------|
|  A   B   C   D    E |   表頭區
|---------------------|
|  As  5   10  8    5 |   數
|  bd  54  58  89   62|   據
|  aw  0   5   2    2 |   區
|---------------------|
|  3   69  73  99   69|   匯總區
|_____________________|
_______________________
| 組:Brrr            |   組    
|---------------------|
|  A   B   C   D    E |   表頭區
|---------------------|
|  A!  15  10  8    5 |   數
|  d@  54  58  80   2 |   據
|  sd  0   5   2    2 |   區
|---------------------|
|  3   69  73  90   9 |   匯總區
|_____________________|
 
 像這我隻有以DataEnvironment加DATAreport中實現吧,但不能重新打開報表,我隻知道這方法,當然大家肯定有好的方法能實現這報表的,還望指點,謝謝!

解决方案 »

  1.   

    '使用datareport控件Option Explicit
    Public cnn As New ADODB.Connection
    Public rst As New ADODB.Recordset
    Public cnnstr As String '联络数据的字符串Sub conn()
        cnnstr = "Provider=msdatashape;data provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\数据库.mdb"
        cnn.ConnectionString = cnnstr
        cnn.Open
    End Sub'打印之前运行connsub 打印()Dim rststr As Stringrststr = " SHAPE {select A,B,C,D,E from 表 } as newtab compute newtab by 分组字段1"rst.Open rststr, cnn, adOpenKeyset, adLockOptimistic, adCmdTextWith rep
      Set .DataSource = rst
      .Sections(2).Controls("text1").DataField = "分组字段1"
      .Sections(3).Controls("text2").DataMember = "newtab"
      .Sections(3).Controls("text2").DataField = "A"
      .Sections(4).Controls("Function1").DataMember = "newtab"
      .Sections(4).Controls("Function1").DataField = "A"
      ...
      
      .Show
    End With
    end sub
      

  2.   

    請問Letter紙張是數值是多少,我怎麼樣能才把報表設為8.5IN與11IN的紙張
    並且是連紙,要是能自動得到針打或能打印出此紙張的打印機就好了
    還望幫忙,謝謝!
      

  3.   

    夏颂:
    怎麼樣得到.Sections(4).Controls("Function1").DataField = "A"的記錄數而非匯總請教設置為何值