all day I couldnt find a thing that helps this terrible grouping problem. Jocasio mentioned something about the SHAPE statement which actually gives a hope ... but I am not sure how to use it nor that it's extly that thing. Here is what the problem is exatly:
when I add the grouping level to the report it starts telling me that report does not match the datasouse. I hate the data environment, otherwise I know there is a way there. But I want to do the whole thing in code and here is what I have as code
Private Sub DataReportFill(DataReport As DataReport, cmdtext As String)
Dim Cnn As New ADODB.Connection
Dim mrst As New ADODB.Recordset
Dim Cmd As New ADODB.Command
With Cnn
.ConnectionString = "Provider=SQLOLEDB.1; " & _
"Integrated Security=SSPI; " & _
"Persist Security Info=False; " & _
"Initial Catalog=" & Databasename & "; " & _
"Data Source=" & Databaseserver & ""
.CursorLocation = adUseClient
.Open
End With
With Cmd
.ActiveConnection = Cnn
.CommandType = adCmdText
.CommandText = "select A, B, C, D from SomeTable where A = '" & UserDefinedA & "'"
End With
Set mrst = Cmd.Execute
With DataReport
Set .DataSource = mrst
End With
End Sub
what I need to display here is show the details B, C, D in Section2 of the report and in Section6 - The grouping section to have A.
Anyone, ideas?....
when I add the grouping level to the report it starts telling me that report does not match the datasouse. I hate the data environment, otherwise I know there is a way there. But I want to do the whole thing in code and here is what I have as code
Private Sub DataReportFill(DataReport As DataReport, cmdtext As String)
Dim Cnn As New ADODB.Connection
Dim mrst As New ADODB.Recordset
Dim Cmd As New ADODB.Command
With Cnn
.ConnectionString = "Provider=SQLOLEDB.1; " & _
"Integrated Security=SSPI; " & _
"Persist Security Info=False; " & _
"Initial Catalog=" & Databasename & "; " & _
"Data Source=" & Databaseserver & ""
.CursorLocation = adUseClient
.Open
End With
With Cmd
.ActiveConnection = Cnn
.CommandType = adCmdText
.CommandText = "select A, B, C, D from SomeTable where A = '" & UserDefinedA & "'"
End With
Set mrst = Cmd.Execute
With DataReport
Set .DataSource = mrst
End With
End Sub
what I need to display here is show the details B, C, D in Section2 of the report and in Section6 - The grouping section to have A.
Anyone, ideas?....