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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group Footer question ??

Status
Not open for further replies.

hanglam

Programmer
Dec 11, 2002
143
US
Hi,

I'm using CR 9.0 with .NET .

I created a report that group records based on a City field and I have a group footer "set to print at the bottom of the page" to print out the some information about the city when the last record of the group is printed.

But sometimes the Group footer is printed in a new page all by itself with no records in it. I know it is because there was not enough space in the previous page so my question is:

How do I make sure that the group footer is printed with at least one record on the same page ?

Thanks,
Hang
 
Go to report->group expert->options->check "Keep group together". That should do it. Or, you could copy the detail fields into the group footer section and then go to the section expert->details->suppress->x+2 and enter:

onlastrecord or
{table.field} <> next({table.field})

This would suppress the last record in each group, so that it appears only in the group footer.

-LB
 
lbass,

A "group" of records sometimes span two pages or more ( for example City:New York can have tow or more pages of records and City:Boston could have only one page), the group footer would display information about the city once the last record of that group is printed . So for each City, I want to display a footer with information about that city.
But sometimes, the group footer displays on the next page (an empty page) with not records in it.

Also, The group footer is "set to print at the bottom of the page "

1. "report->group expert->options->check "Keep group together". I tried this solution, but it didn't work .

2. Can you explain solution #2 better. I don't understand what you are trying to tell me. YOu want me move everything from "Details" section to the "Group Footer section" ?

Thanks,
Scott

 
Yes, that is what I meant, but I had forgotten that you had "Print at bottom of page checked", so I don't think that's the route to go anyway.

You could set up a record count per page and then force a new page before the last record if the running total was equal to the last count that could appear on the page.

Create two formulas:

//{@reset} to be placed in the page header:
whileprintingrecords;
numbervar linecnt := 0;

//{@linecnt} to be placed in the detail section:
whileprintingrecords;
numbervar linecnt := linecnt + 1;

Note at what linecnt the group footer jumps to the next page. Let's say it is at line 40, and let's say the group footer takes up about 5 lines. Then go to the section expert->details->new page before->x+2 and enter:

not onlastrecord and
count({table.groupfield},{table.groupfield}) <= 45 and
{@linecnt} = 40

This would force a page break at line 40 unless there a higher number of records that would have moved to a second page anyway.

-LB
 
I think lbass suggestion to place detail in group footer will work if the group footer has two subsections. Footer a will print just below the detail section and have footer b print at bottom of page.
MrBill
 
thanks guys, I would try both solutions over the weekend and
get back here to tell you whether it works or not.

Again, Thanks for all the repplies.

Scott

 
damn,

stupid question...
how do you add a formula to the a page section (Page Header, Details ,etc ) ?

Also, where does the "count({table.groupfield},{table.groupfield}) <= 45 " line supposed to do ?

Thanks,
Scott

PS. As you can see from my question, I don't use Crystal a lot, just whenever I need to print simple reports .

 
I would suggest trying the 1st solution first - adding the data to the group footer with sections 'a' and 'b'. If that works you won't need the 'count' formulas.

MrBill
 
As MrBillSC suggested, try using my first suggestion after all--just copy the details into GF_a, and in the section expert, format only GF_b to print at the bottom of the page. You would also need to select the details while in the section expert->suppress->x+2 and add the formula from my first post.

To place a formula on the report, just drag it from the field explorer. In my second solution, you need to go to the section expert. If you right click on the gray area to the left of the report, "section expert" of "format section" should be an option. Or look for it in the dropdown menus. In 8.5, it was in the format dropdown (format->section), while in XI, it is in report->section expert.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top