|
-
Jul 21st, 2005, 04:44 PM
#1
Thread Starter
Junior Member
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
-
Jul 22nd, 2005, 01:37 AM
#2
Addicted Member
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
-
Jul 22nd, 2005, 01:40 AM
#3
Addicted Member
Re: grouping in datareport
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|