Group Data
eg table
Code Foodtype Food rate
001 Food Rice 100.00
002 Food Wheat 150.00
003 Food Cereals 80.00
004 Drinks Coke 20.00
005 Drinks Pepsi 20.00
006 Drinks Beer 80.00
i want report as follows:
Type Total
Food 330.00
Drinks 120.00
Total 450.00
how i group data i can't make
Code Foodtype Food rate
001 Food Rice 100.00
002 Food Wheat 150.00
003 Food Cereals 80.00
004 Drinks Coke 20.00
005 Drinks Pepsi 20.00
006 Drinks Beer 80.00
i want report as follows:
Type Total
Food 330.00
Drinks 120.00
Total 450.00
how i group data i can't make
Comments
You can group your data in SQL, or in the report.
I suppose you are not able to use sql?
In the report, here is how it can be done:
Drop 5 bands on your report:
- 1 x page header
- 1 x masterdata
- 1 x group header
- 1 x group footer
- 1 x report summary
Arrange them like this:
PageHeader
GroopHeader
MasterData
GroupFooter
ReportSummary
Your datasource must be sorted by 'FoodType'.
Attach MasterData to your datasource, and set the height of the band to 0.
Set also the height of groupheader to 0.
In PageHeader you drop 2 memos for headers.
In Groupheader.condition you add the 'FoodType'-field (double-click you band to set condition).
In Groupfooter you drop 2 memos. One for data field [MyDb."FoodType"] , and one for the summary: [sum(<MyDb."RATE">)]
In ReportSummary you drop 2 memos. One for det label 'Total' and one for the summary: [sum(<MyDb."RATE">)]
Petter