Solved

Data Reports

Posted on 2001-06-14
4
256 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

738 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