Group Headers

  • Thread starter Thread starter Tony Botelho
  • Start date Start date
T

Tony Botelho

I have recently been given a new database and the task of
creating reports that look *exactly* like the reports
that were generated by the old database. (The old
database happened to be in FoxPro).

The problem I'm running into is I have to generate a
report that groups on a CATEGORY field, but I need the
header to be decidedly different for each CATEGORY (the
underlying query is a union query of the various
categories). It will basically look something like this

[group header]
CATEGORY 1
QTY DESCRIPTION LENGTH TYPE
[detail]
1 item1 6' special
3 item2 8' standard

[group header]
CATEGORY 2
QTY ITEM ID PART NUMBER COLOR
[detail]
1 AO1 T003 blue
2 A02 T071 green


I know I can do this by creating multiple headers,
overlaying them and turning the .visible property on/off
depending on which category is active, but this seems
awfully clutured and does not lend itself to easily
editing items once other items have been placed on top of
them.

Is there a way to create different multiple group headers?


Thanks in advance
Tony
 
Tony said:
I have recently been given a new database and the task of
creating reports that look *exactly* like the reports
that were generated by the old database. (The old
database happened to be in FoxPro).

The problem I'm running into is I have to generate a
report that groups on a CATEGORY field, but I need the
header to be decidedly different for each CATEGORY (the
underlying query is a union query of the various
categories). It will basically look something like this

[group header]
CATEGORY 1
QTY DESCRIPTION LENGTH TYPE
[detail]
1 item1 6' special
3 item2 8' standard

[group header]
CATEGORY 2
QTY ITEM ID PART NUMBER COLOR
[detail]
1 AO1 T003 blue
2 A02 T071 green


I know I can do this by creating multiple headers,
overlaying them and turning the .visible property on/off
depending on which category is active, but this seems
awfully clutured and does not lend itself to easily
editing items once other items have been placed on top of
them.

Is there a way to create different multiple group headers?


No, a section is what it is. Manipulating the visible
property is one way to do this kind of thing.

A different way to approach this issue would be to use a
separate report for each category. The subreports could
then be placed one after another as subreports in an unbound
main report.
 
One possible method would be to add the header titles to your union query as
"fields". Then the values could be assigned to textboxes instead of to labels
in the report. The values of the first record in the group are available in the
header of the group.

SELECT "Qty" as Lbl1, "Description" as Lbl2,
"Length" as Lbl3, "Type" as Lbl4,
fldQty, fldDesc, fldLength, fldType
FROM SomeTable
UNION ALL
SELECT "Qty", "Item ID", "Part Number", "Color",
fldQty, fldItemID, fldPartNum, fldColor
FROM SomeOtherTable
....

Then in the group header assign the control over the first column to use the
value of Lbl1, etc.
 
Back
Top