Results 1 to 3 of 3

Thread: grouping in datareport

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2005
    Posts
    17

    grouping in datareport

    hello evryone
    i have a recordset, which i want to group by name, and then to disply it in a report, also groupd by name.
    i don't realy know how to work with reports in vb, so i'll be glad if you can explain me how to do this.
    i am working with vb6 and access 2000.
    thank's a lot
    daniel

  2. #2
    Addicted Member BestS's Avatar
    Join Date
    Mar 2005
    Posts
    222

    Re: grouping in datareport

    Take a DataReport, Right click on it then Insert Group Header Footer

    Put a TextBox on the Group Section and Set it's property "DataField" to NAME
    in the detail section the other data, then use code like this and you will have a Grouped by Name Datareport

    Private Sub DataReport_Initialize()
    Dim strSQL As String
    Dim strTo As String
    Dim strFrom As String
    Dim oConn As New ADODB.Connection
    Dim oRS As New ADODB.Recordset

    oConn.CursorLocation = adUseClient
    oConn.ConnectionString = DataEnvironment1.Connection1
    oConn.Open

    strSQL = "SHAPE { SELECT NAME FROM TABLE1 } AS Command1 APPEND " & _
    "({ SELECT SOMETHING FROM TABLE2} AS Command2 RELATE 'ID' TO 'ID1') AS Command2 "

    oRS.Open strSQL, oConn, adOpenForwardOnly
    Set drSAP.DataSource = oRS

    End Sub

  3. #3
    Addicted Member BestS's Avatar
    Join Date
    Mar 2005
    Posts
    222

    Re: grouping in datareport

    If this was not enough here's a link

    http://msdn.microsoft.com/library/de...datareport.asp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width