record sections do not match data source ( data report)

record sections do not match data source ( data report)

Post by sira » Wed, 14 Nov 2001 23:46:38



Hi,
 I am using paradox database and an odbc connection. i am trying to create a
report using the following code.

But i get the error "record sections do not match data source".

Private Sub Report_Click()
// declarations are done here

Set Rst = New ADODB.Recordset
Set Rst.ActiveConnection = Cn
Rst.CursorType = adOpenStatic
Rst.CursorLocation = adUseClient

'Set file name
File_Name = Chart.ListFiles.List(Chart.ListArchives.ListIndex)

 SQLQuery = " SELECT * INTO newarchidx FROM archidx.DB  "
 SQLQuery = SQLQuery & "WHERE [Filename]= '" & File_Name & "'"
Rst.Open SQLQuery

Set Rst= New ADODB.Recordset
Set Rst.ActiveConnection = Cn
Rst.CursorType = adOpenStatic
Rst.CursorLocation = adUseClient
SQLQuery = "SELECT comment, Count(status) AS CompteDestatus  INTO
newevent.DB From  " & File_Name & " GROUP BY comment, status HAVING
(((status) Is Not Null));"
Rst.Open SQLQuery

Set Rst = New ADODB.Recordset
Set Rst.ActiveConnection = Cn
Rst.CursorType = adOpenStatic
Rst.CursorLocation = adUseClient
SQLQuery = "SELECT * INTO newreport FROM newarchidx,newevent  ORDER BY
[newevent].[CompteDestatus]"
Rst.Open SQLQuery

Set Rst = New ADODB.Recordset
Set Rst.ActiveConnection = Cn
Rst.CursorType = adOpenStatic
Rst.CursorLocation = adUseClient
SQLQuery = "SELECT * FROM newreport.DB"
Rst.Open SQLQuery
Set DataReport.DataSource = Rst

If Not Rst.EOF Then
Tstart = Rst.Fields(2).Value
  Tstop = Rst.Fields(3).Value
  End If

DataReport.Sections(2).Controls(2).Caption = File_Name
DataReport.Sections(2).Controls(3).Caption = Tstart
DataReport.Sections(2).Controls(5).Caption = Tstop

Set Rst = New ADODB.Recordset
Set Rst.ActiveConnection = Cn
Rst.CursorType = adOpenStatic
Rst.CursorLocation = adUseClient
SQLQuery = "DROP TABLE newarchidx,newevent,newreport"
Rst.Open SQLQuery

End sub.

Im my report structure;
-------------------------
****************************************************************************
*******************
report header(section 4)

page header(section 2)
------------
ArchiveName  label
                        --------
Archive starts from label to label
                               ----      -----
Group header(section 6)
--------------
         6   Textboxes bound to field names present in the newreport.db
table

Detail (section 1)
-------
Comptestatus                                    comment           '  (bound
to fields present in newreport.db)

group footer
---------------
page footer
-----------
report footer

****************************************************************************
*****************

Does any body have the solution to this problem.

with regards,
siraj

 
 
 

1. report sections do not match the data source

Hi Friends,

Can any body help me to get a data report having group header/footer
during the runtime itself. Here i am not using a Data Environment, but
reprot gets the data source from an ADO Recordset. It is working fine,
but if I put a group header with out a group field, it shows an error
saying "report sections do not match the data source". Iwould like to
get the out put as follows. Pls help me.

4 Wheel Drive
             Lands Cruiser
             Nissan Patrol
             Pajero
             Pathfinder

Passenger Car
             BMW
             Mercedes
             Mazda 6

Thanks in advance.

A. Sujith Kumar

--
Posted via http://dbforums.com

2. Informix and MS Access

3. "Report section doesn't match data source" in data report

4. Schema Manager and sequences (bug?)

5. matching Data that is not an exact match

6. Getting Unix environment variable from SQL or PL/SQL

7. data source in the report does not refresh

8. SQL Statement - Including the Table Name

9. Reset source of data for Data Report on Load

10. Data Source: Programmatically Configuring an ODBC Data Source - HELP PLEASE

11. Help:ODBC Data Source Admin doesn't show Names of new Data Sources

12. cannot add MSAccess 97 data source in ODBC Data Source Admin

13. First record in recordset not displayed in Data Report