Solved

Data Reports

Posted on 2001-06-14
4
246 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

763 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

12 Experts available now in Live!

Get 1:1 Help Now