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
Solved

Data Reports

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

839 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