Link to home
Start Free TrialLog in
Avatar of jana
janaFlag for United States of America

asked on

How to insert Groups in DataReport in VB6

How can I insert a Group Header in a Data Report  and have values in them?

I know I right-click and choose Insert Group.  Then I insert the Text Box and assign the fiel;d.

But when running I get the error:

"Report Sections do not Match Data Source"
Avatar of 3_S
3_S

You must make sure your sql statement contains a group by clausule. Post your sql statement.
Avatar of jana

ASKER

Understood.  Here is my SQL statement:

select TableParent.Vendorid, TableParent.VendorInvoiceNo,TableParent.DateReconcile,
       TableChild.VendorItem, TableChild.Cost1, TableChild.Cost2, TableChild.Cost3,
       sum((TableChild.cost1-TableChild.cost2)) as DiffFound,
       sum((((TableChild.cost1-TableChild.cost2)*TableChild.Cost3)*-1)) as Total
From TableParent
Join TableChild
on TableParent.receiptno=TableChild.receiptno
where TableParent.VendorID = '01032'
group by Vendorid, VendorInvoiceNo, ReceiptNo, DateReconcile,
         VendorItemID, VendorItemDescr
order by TableParent.Vendorid, TableParent.VendorInvoiceNo,TableParent.DateReconcile, TableChild.VendorItem

With this sql statement, can I display the detail line of:

Vendorid, VendorInvoiceNo, DateReconcile,VendorItem, Cost1, Cost2, Cost3, SumValue1, SumValue2

and also have the subtotal of

SumValue1, SumValue2

.....

This is the part I don;t quite understand.  How to relate the sql script with the DataReport  "Group Header / Footer"

Please shed some light on this.

ASKER CERTIFIED SOLUTION
Avatar of 3_S
3_S

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jana

ASKER

I'll try
Avatar of jana

ASKER

I use SQL 2000 but somehow it didn't work
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jana

ASKER

still same problem
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jana

ASKER

Hello, please excuse not attending the questions, we've been out.  We'll followup shortly thank you
Avatar of jana

ASKER

Hi...
Could you post what you have so far and add what is causing you problems?