Solved

Data Reports

Posted on 2001-06-14
4
248 Views
Last Modified: 2010-05-02
I am trying to use VB6 Data Report, I want to group three different fields from a Stored Procedure. I tried to insert 3 Group Header/Footer and then placed each field respectively in each group header. I got the error "Report Sections do not match Data Source". How can I get my report to group the data I need and display properly? (The report works fine with no Group Header/Footer present) Any examples would be great. Thanks
0
Comment
Question by:RobMike
4 Comments
 
LVL 1

Expert Comment

by:thuannc
ID: 6193565
In this case you should use SHAPE command to get Hierachical Recordset then set parent recordsets to Group Headers & Footers, set child recordset to Detail. SHAPE command require Provider=MSDataShape in connection string. What kind of DB you are using???
0
 
LVL 1

Accepted Solution

by:
Celia earned 50 total points
ID: 6193728
This is an example which is used to create a data report based on 3 command(Command 1,Command 2 & Command3)

using the same table to be grouped by two group header (Year & Class) in DataEnvironment.

Command1(Group By Year-First)->Parent

General Tab
Command Name : Command1
Connection : Database Location
Sql Statement : SELECT [year],[date] FROM Admission WHERE [date] = VDate GROUP BY [year],[date]

Parameter Tab
Name : Vdate
Direction : Input
Data Type : AdDate
Host Data Type : Date(VT_Date)

Command2(Group By Class-Second)->First Child

General Tab
Command Name : Command2
Connection : Database Location
Sql Statement : SELECT [class],[year],date] FROM Admission WHERE [date] = VDate Group By [class],[year],

[date]

Parameter Tab
Name : Vdate
Direction : Input
Data Type : AdDate
Host Data Type : Date(VT_Date)

Relation Tab
Relate to a parent command object
Parent command : Command1
In Relation definition : Link year(Parent Field) to year(Child Field) & date(Parent Field) to VDate(Child

Field).

Command3(Display the information in detail section based on user criteria)->Second Child

General Tab
Command Name : Command3
Connection : Database Location
Sql Statement : SELECT * FROM Admission WHERE [date] = VDate

Parameter Tab
Name : Vdate
Direction : Input
Data Type : AdDate
Host Data Type : Date(VT_Date)

Relation Tab
Relate to a parent command object
Parent command : Command2
In Relation definition : Link year(Parent Field) to year(Child Field),class(Parent Field) to class(Child

Field) & date(Parent Field) to VDate(Child Field).

Report Form
Name : Report

Private Sub AdmissionRpt_Click()
DataEnvironment1.command1 adate.Value
DataReport1.Show
End Sub

Note : adate is a date variable extracted from datetimepicker control.

Hope that it will help u.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7136156
Hi RobMike,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept Celia's comment(s) as an answer.

RobMike, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7173331
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows 10 start screen issues 9 51
How does CurrentUser work? 10 31
vb6, excel Run-time error 1004 method 'close' of object 'workbooks' failed 7 41
Spell Check in VB6 13 95
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now