Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keeping groups together 1

Status
Not open for further replies.

teachmecr

Programmer
Oct 1, 2006
72
US
I have a report that has some grouping. I want to keep the group together yet at the same time when one group heading has lots of details and it can't fit with other headings on one page i get blank spaces on the pages. What it does that it keeps the group toghether. But if i have that option off i dont get any blank spaces but i get group header at the bottom of the page with nothing below it and it continues to the next page. Is it possible that i don't have the groups together option turned on and i dont get any blank spaces or group headings at the bottom of the page with no details. im using CR 10. Thanks
 
You can avoid orphaned group headers by printing the first detail line in the group header section, select the "keep together" option in the group header Section expert and suppressing the detail section for the first record of each group. To do this:
1. expand the group header the width of the detail section and copy all objects in the detail section and paste them in the expanded area of the group header.

2. In the Section expert, select the detail section. Conditionally suppress the detail section as follows:
OnFirstRecord or
{table.groupfield} <> Previous({table.groupfield})

where table.groupfield is the field you have grouped on.

3. In the Section expert select the group header that contains the first detail record and check the "keep together" box.

MrBill
 
well it works for some groups but for others it doesn't..for instace for the very first group it repeats the record and then in the middle for some groups it doesn't suppress the record...it displays it twice. thanks for ur help
 
When the group continues to the next page..thats when it doesn't suppress the first record in the detail section..
 
If you have the group header set to repeat on each page, then select the detail fields that you have copied into the page header->format field->suppress->x+2 and enter:

inrepeatedgroupheader

-LB
 
It still doesn't work. The first group displays the dup im not sure how to fix it. thanks
 
I think you forgot to add the first clause in MrBillSC's suggestion:

onfirstrecord and

If this doesn't fix it, you should samples of what is happening, indicating sections and page breaks for each row.

-LB

 
nope it just doesn't work for the very first group and plus if the group continues to the next page it works but it gives white space above the the first record in detail section
 
Please tell us exactly what you did, showing the formulas used and where you put them.

Did you use section suppression as suggested and not field suppression?

There is no reason I can think of that this wouldn't work. You should also format the detail section to "suppress blank section" to eliminate white space.

-LB
 
You are correct teachmecr. Try the following fix:
add subsection GH1b to your report and move the detail fields from GH1a to GH1b and shrink GH1a back to its original size. GH1b should be the same size as the detail section.

Remove all conditional suppressing of GH1a.
Add conditional suppressing to GH1b as follows:
{table.groupfield} = Previous({table.groupfield})

Conditionally suppress detail section as follows:
OnFirstRecord or
{table.groupfield} <> Previous({table.groupfield})

You were getting duplicates because you are printing the group header at top of each page.

The above mod seems to work for me.

MrBill
 
It works for everything else but it still gives the duplicate for the very first group on the first page. i did what u suggested..This is my conditional suppression on Ghb ({myview.account}= Previous({myview.account})
then i have conditional suppression on detail section as follows:
Onfirstrecord or ({myview.account}<> Previous({myview.account})
 
It looks like it doesn't suppress the first record in detail section in the very first group on the first page..
 
Comment out the conditional suppress in the detail section and view. Is it possible that you actually do have two records the same and the first is being suppressed in the detail section and displayed in header? I ran into this when testing my code! There were actually duplicate records in the first group.

MrBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top