Hide or Show headers depending on subreport content

  • Thread starter Thread starter You can call me Al
  • Start date Start date
Y

You can call me Al

I'm writing a report with 3 cascading levels of
information; from a group to orders to parts in the order.
The parts are in a subreport. All works, but I'd like to
hide the order labels (in a row above the data) when there
are no parts under the preceding record. In this way, each
order will stack underneath its headings, like the part
subreport format.

If I have a new order, I want to repeat the label if the
previous order had parts (underneath in the subreport),
otherwise I do not want to repeat the label.

Here's
how the data should look:

Net Start (top level)
000205000 1/1/04

Order (next level)
000504231
000642385
Part (subreport level)
23232323

Order
000589898

Net
000206000

Order (grouped, labels not repeated)
000569694
000696985
000489654
000358654
Part
23589
56879

Order
000569874

What I get is like this:

Net Start (top level)
000205000 1/1/04

Order (next level)
000504231

Order
000642385
Part (subreport level)
23232323

Order
000589898

Net
000206000

Order (Orders not grouped)
000569694

Order
000696985

Order
000489654

Order
000358654
Part
23589
56879

Order
000569874
 
You said:
I'm writing a report with 3 cascading levels of
information; from a group to orders to parts in the order.
The parts are in a subreport. All works, but I'd like to
hide the order labels (in a row above the data) when there
are no parts under the preceding record. In this way, each
order will stack underneath its headings, like the part
subreport format.

If I have a new order, I want to repeat the label if the
previous order had parts (underneath in the subreport),
otherwise I do not want to repeat the label.

Here's
how the data should look:

Net Start (top level)
000205000 1/1/04

Order (next level)
000504231
000642385
Part (subreport level)
23232323

Order
000589898

Net
000206000

Order (grouped, labels not repeated)
000569694
000696985
000489654
000358654
Part
23589
56879

Order
000569874

What I get is like this:

Net Start (top level)
000205000 1/1/04

Order (next level)
000504231

Order
000642385
Part (subreport level)
23232323

Order
000589898

Net
000206000

Order (Orders not grouped)
000569694

Order
000696985

Order
000489654

Order
000358654
Part
23589
56879

Order
000569874

I might or might not be able to find a way to do this, but I
still need more details about your report.

What is the record source table/query of the main report?

What is the record source table/query of the subreport?

What do you have in Sorting and Grouping?

Is the Net label and number in a group header

Is the Order label and number in a group header?

What do you have in the Detail section?

What are the subreport's Link Master/Child properties set
to?
 
-----Original Message-----


I might or might not be able to find a way to do this, but I
still need more details about your report.

What is the record source table/query of the main report?
A query relating orders to networks
What is the record source table/query of the subreport?

A query relating parts to orders
What do you have in Sorting and Grouping?

I have tried various grouping and sorting methods, from
page header, net header, net title header, order header,
order title header to just net header and everything in-
between.
Is the Net label and number in a group header?
Yes

Is the Order label and number in a group header?

Was but is not now. I even tried two layers of subreports,
but it slows down the report considerably
What do you have in the Detail section?
Order fields and parts subreport
What are the subreport's Link Master/Child properties set
to?

links to order
 
OK, I think, maybe, I might have an idea on this. First
create a group with header for the Order field. Move the
Order labels to the order group's header section, just the
labels, nothing else. Adjust the position of the remaining
stuff in the detail section to eliminate the space vacated
whe you moved the labels. Finally, add a line of code to
the detail section's Format event procedure:

Me.GroupHeader1.Visible = Me.subreportcontrol.Report.HasData
 
Back
Top