Solved

Data Reports

Posted on 2001-06-14
4
250 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

770 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